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.

VN:F [1.9.22_1171]
Rating: 5.0/5 (1 vote cast)
VN:F [1.9.22_1171]
Rating: +1 (from 1 vote)
VIM - Filter Quickfix List, 5.0 out of 5 based on 1 rating

2 Comments

 Add your comment
  1. How do you use this ? it doesn’t seem to do anything on an Ack results list. I’m trying :QFilter “somestring”

    VA:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
    • I filter by the name of the files in the result. Simply say :QFilter ‘file|folder’ and the list will be filtered to that.

      VN:F [1.9.22_1171]
      Rating: 0 (from 0 votes)

Leave a Reply