Vim: Quickfix List
The quickfix list is a list of file locations along with a number of builtin commands to help navigate the list.
The canonical use case is compiler error messages. Using the quickfix list you can quickly navigate to the exact location in the affected file, correct the error, and then move on to the next error.
Quickfix is not restricted to compilers, a number of Vim tools (e.g.
:vimgrep
) also send output to the quickfix list.
The quickfix list acts like any other window and is usually opened
automatically by the tools that are interacting with it. You can navigate
the list using j
and k
and press enter
to jump to the currently selected
location. You can navigate the quickfix list even when the quickfix window is
closed (this is surprisingly useful).
Commands:
:copen
open the quickfix list:cclose
or:ccl
close:cnext
or:cn
next item:cprev
or:cp
previous item:cfirst
first item:clast
last item:cc<n>
nth item
The vim-unimpaired
plugin adds useful convenience mappings:
[q
previous item]q
next item[Q
first item]Q
last item
The quickfix list is global to the current vim session, but Vim remembers up to ten quickfix lists. When a new quickfix list is created, the previous ones are pushed down the stack. You can access previous quickfix lists using the following commands:
:colder
or:col
previous quickfix list:cnewer
of:cnew
next quickfix list
Location Lists
While the quickfix list is global to the current vim session, location lists are window specific.
They have there own (similar) set of commands:
:lopen
open the location list:lclose
or:lcl
close:lnext
next item:lprev
previous item:lfirst
first item:llast
last item:ll<n>
nth item:lolder
or:lol
previous quickfix list:lnewer
of:lnew
next quickfix list
The vim-unimpaired
plugin also adds useful convenience mappings for location
lists:
[l
previous item]l
next item[L
first item]L
last item
Resources
:help quickfix.txt