How do you use vim's quickfix feature?

Viewed 95563

I'm a pretty new Vim user and I've found that its learning curve is quite steep (at least for me). I just installed this vim script for JavaScriptLint error checking, which shows errors in vim's quickfix window once I save a buffer.

However, I don't know what to do next.. How do I 'scroll' through all the errors? How do I close the quickfix 'window'? How do I get it to check for errors after I've made changes to my code?

I've looked at the vim quickfix docs but the amount of commands are overwhelming and I can't seem to find what I want. Any help would be appreciated.

A side question: is there any way to have javascriptlint check for js errors for code residing in a .html file?

9 Answers

In addition to @DrAl great answer about how to open and close the quick window and navigate between entries, I made an image toshow some of the other quick fix navigation commands.

Each group of 3 files below represents a set of quickfix results, e.g. from a vimgrep. cnewer and colder are for going through historic result sets. enter image description here

Although this requires > Vim 7.4.858, the cdo (or ldo for location lists) command allows updating a non-contiguous set of lines in a way you could once only do with sed:

:vimgrep /re/ %:p
:cdo! norm @a
# or
:cdo! s/re/repl/

The above shows running a recorded macro or a simple search and replace. Missing seems to a be a way to pipe through and external command as you can with :range! command

Related