2008/05/13

Using :vimgrep inside VIM

Grep is really power tool under the UNIX domain. From Vim 7, an internal `grep` was provided by Vim.

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 the  and 
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

没有评论:

BlockChain 相关电子书

@copyright of Sam Chadwick   - https://thehub.thomsonreuters.com/groups/bitcoin/blog/2017/09/10/blockchain-paper Blockchain Papers A c...