How do you use vim's quickfix feature?

前端 未结 8 1200
清酒与你
清酒与你 2020-12-22 15:20

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, whic

8条回答
  •  感情败类
    2020-12-22 15:39

    The easiest way to navigate the quickfix list (or the location list, for that matter) is the unimpaired plugin.

    Once the quickfix window is populated, [q and ]q go forward and back (respectively) in the quickfix list. [Q and ]Q go to the beginning and end (which is especially handy if you only have one item in the list; this makes vim complain about [q and ]q). So the workflow is:

    1. Run whatever command populates the quickfix list
    2. Type [Q to go to the first item
    3. Scroll through subsequent items (if any) with [q and ]q

    If you're using Syntastic, you'll get the location list instead of the quickfix list. No problem; just use [L, ]L, [l, and ]l in the same way.

    unimpaired has loads of other handy mappings too -- [e and ]e "bubble" lines up and down, [ and ] insert blank lines above and below, etc. I was surprised nobody mentioned it here before; that's probably because it didn't exist until January 2010, though the question was asked in 2009.

提交回复
热议问题