VIM – Filter Quickfix List

If you are used to using the quickfix list in VIM there are times when you want to filter certain things out of the quickfix list to narrow it down to relevant results that you need. Rather than firing the quickfix command all over again with a refined expression, it is easier & often faster to simply remove items from the list. I wrote this simple vimscript to do just that.

Using the above now allows you to filter the quickfix list by calling :QFilter pattern. By default it filters the list to keep results matching the pattern but if you call it :QFilter! pattern. it will remove results that match the pattern.

2 thoughts on “VIM – Filter Quickfix List

    1. dhruvasagar Post author

      I filter by the name of the files in the result. Simply say :QFilter ‘file|folder’ and the list will be filtered to that.

      Reply

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.