vimvimgrep

How to jump between patterns when using :vimgrep (Quickfix list)?


I am new to vim, and still exploring some features of it. I have a problem with vimgrep. I can search for a pattern like this vimgrep /define/ ** so that it finds and opens next file that contains a define. But I couldn't yet find out how to go to the next file/line that matches my pattern. Any pointers?


Solution

  • Useful commands for the quickfix list (brackets around omittable part of the commands):

    Needless to say there are plenty of other commands and you can discover them at :help quickfix.

    Personally I have the following maps :

          | ø      | SHIFT   | CTRL
    ------+--------+---------+---------
    <F11> | :cprev | :cpfile | :colder
    <F12> | :cnext | :cnfile | :cnewer
    

    Of course if you use the location list instead of the quickfix list (:lvimgrep) the same commands exist, just replace the initial c with an l and that's it.

    Vim 8 Additions: