Useful commands for the quickfix list (brackets around the omitted part of the commands):
:cn[ext] and :cp[revious] go to the next and previous record:cnf[ile] and :cpf[ile] go to the next and previous file (if the quickfix list is not sorted by file, you can write a function that getqflist() performs sorting and then setqflist():cr[ewind] and :cla[st] go to the beginning or end of the quick delete list:col[der] and :cnew[er] will go through the historical quick fix lists.
Needless to say, there are many other commands, and you can find them in :help quickfix .
Personally, I have the following cards:
| ΓΈ | SHIFT | CTRL ------+--------+---------+--------- <F11> | :cprev | :cpfile | :colder <F12> | :cnext | :cnfile | :cnewer
Of course, if you use the list of locations instead of the quickfix ( :lvimgrep ) list, then the same commands exist, just replace the initial c with l and it.
Vim 8 Add-ons :
:cdo : run the command for all entries in the quick delete list. For example :vim /foo/ *.cpp *.h *.hpp may follow :cdo s/pattern/replacement/g:cfdo : run the command all files in quickfix list. For example, photos :vim /foo/ *.cpp *.h *.hpp may follow :cfdo %s/2ndpattern/2ndreplacement/g
Benoit Oct 24 '11 at 19:15 2011-10-24 19:15
source share