mhinz/vim-grepper

How to close the search result window?

Leviathan1995 opened this issue · 4 comments

I bind the F10 to open vim-grepper, but how can I close the result window by a map command?

lbonn commented

The result window is just a regular quick list window, this question is out of scope for vim-grepper I would say.

Personally, I use https://github.com/romainl/vim-qf:

nmap <silent> <Leader>eq <Plug>(qf_qf_toggle)

@Leviathan1995 You can simply use :cclose or example below to Toggle Search.

function! ToggleSearch()
    if empty(filter(getwininfo(), 'v:val.quickfix'))
        :Grepper
    else
        cclose
    endif
endfunction

nnoremap <C-f> :call ToggleSearch()<cr>