Is it possible to grep the quickfix window in Vim?

后端 未结 4 1461
旧时难觅i
旧时难觅i 2020-12-30 08:11

Let’s say I use the ag.vim plugin to search for the string disabled through multiple files. It returns me some results in the quickfix window:

1          


        
4条回答
  •  遥遥无期
    2020-12-30 08:58

    Here's a shorter & neater version of @Kent's answer:

    function! GrepQuickFix(pat)
      call setqflist(filter(getqflist(), "bufname(v:val['bufnr']) !~# a:pat"))
    endfunction
    command! -nargs=* GrepQF call GrepQuickFix()
    

    It is the same code, just neater and shorter, I don't believe it deserves a separate plugin.

提交回复
热议问题