Using `:vimgrep` is fairly easy, just in command mode, type in
:vim[grep][!] /{pattern}/[g][j] {file} ...The `grep` result will be put into the `quickfix` list. The `:cnext`, and `:cprevious` can be used to navigate the `quickfix` list.
Let's do something to help us! Put this into your ~/.vimrc file.
" We can navigate the list by using theand
map <F3> :cnext
map <S-F3> :cprevious
After that, you will be able to use the <F3> and <shift>-<F3> navigate the `quickfix` list easily. :D
没有评论:
发表评论