Giter Club home page Giter Club logo

Comments (4)

dyng avatar dyng commented on August 19, 2024 1

Sorry for this late reply, and thank you for your appreciation!

Compact mode is an interface that looks like quickfix but does not share same behaviors, if you prefer real quickfix window, a quick & dirty solution is using g:CtrlSFAfterMainWindowInit hook.

function! g:CtrlSFAfterMainWindowInit()
    close
    copen
endfunction

Compact mode is a design choice when I didn't fully understand quickfix window. As there are many plugins which enhance quickfix window recently, maybe I'll deprecate the compact mode later.

from ctrlsf.vim.

PezCoder avatar PezCoder commented on August 19, 2024

Thank you for the help! @dyng - This works great ❤️

I'm assuming there wouldn't be a way to get the best of both worlds is it? - I mean having a way to rename things (edit mode) + quick fix list together.

from ctrlsf.vim.

PezCoder avatar PezCoder commented on August 19, 2024

I think let me close this issue as I got the answer for the quickfix list, I had created a separate issue asking that here: #339

from ctrlsf.vim.

PezCoder avatar PezCoder commented on August 19, 2024

Just want to let you know that, the above suggested solution to provide CtrlSFAfterMainWindowInit has some edgecase, especially when doing repeat searches breaks with the following error:

" previous config
let g:ctrlsf_default_view_mode = 'compact' " Quickfix like view
let g:ctrlsf_populate_qflist = 1
let g:ctrlsf_auto_close = {
    \ "compact": 0
    \}
let g:ctrlsf_mapping = {
    \ "next": "j",
    \ "prev": "k",
    \ }
let g:ctrlsf_auto_focus = {
    \ "at": "start"
    \ }
nnoremap <Leader>/ :CtrlSF<Space>

" Opens quickfix window instead of compact window
" Because compact window doesn't stay in sync with quickfix
" https://github.com/dyng/ctrlsf.vim/issues/340
function! g:CtrlSFAfterMainWindowInit()
  close
  copen
endfunction
Error detected while processing function ctrlsf#Search[15]..<SNR>107_ExecS
earch[19]..<SNR>107_DoSearchAsync[4]..<SNR>107_Open[1]..ctrlsf#win#OpenMai
nWindow[67]..<SNR>108_InitMainWindow:
line    7:
E21: Cannot make changes, 'modifiable' is off: fileformat=unix
Press ENTER or type command to continue

Removing that function & using the following configuration worked for me 🎉

" New config
let g:ctrlsf_default_view_mode = 'compact' " Quickfix like view

" Use quick fix list to populate & open instead of ctrlsf window
" https://github.com/dyng/ctrlsf.vim/issues/340
let g:ctrlsf_populate_qflist = 1
let g:ctrlsf_auto_close = 1
let g:ctrlsf_auto_qf = 1

let g:ctrlsf_mapping = {
    \ "next": "j",
    \ "prev": "k",
    \ }
let g:ctrlsf_auto_focus = {
    \ "at": "start"
    \ }
nnoremap <Leader>/ :CtrlSF<Space>

from ctrlsf.vim.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.