vimneovimvim-quickfix

Filter vim's quickfix window per file


I'm using the cquery language server in my Neovim instance. In conjunction with the Languageclient-neovim plugin. This automatically also checks the code for errors in the file that I'm working. However, this also means it checks all the files in my workspace.

I was wondering if there was a possibility to only show errors that are specific to the file that I am working in. See the example below:

Example

I'm working in the file src/bag_rotation.cpp and I only want to filter the quickfix window to only show errors from that file.


Solution

  • Yes, I wrote a vim plugin that, among other things, allows you to perform :Keep <pattern> and :Reject <pattern> on the quickfix window: https://github.com/romainl/vim-qf.

    --- EDIT ---

    Vim has been shipping with :help cfilter-plugin for quite some time, now. It is slightly more basic than my implementation but it might fit one's workflow just fine… and it's "built-in", which is a good thing.