October 2012
346 pages
7h 40m
English
| Tip 110 | Grep with Vim’s Internal Search Engine |
The :vimgrep command allows us to search through multiple files using Vim’s native regular expression engine.
Vim provides a command called :vimgrep, which uses Vim’s built-in search engine. (The command can be abbreviated to :vim.) The syntax looks like this:
| | :vim[grep][!] /{pattern}/[g][j] {file} ... |
When multiple matches are on the same line, the presence of the g flag creates a match for each one of them. Without it, only a single record is created for the entire line. By default, Vim will jump straight to the first match, but you can prevent this by including the j flag.
The {file} argument must not be blank. It can accept the same parameters as the :args command (discussed in ...
Read now
Unlock full access