First things first: Happy New Year! :)
One task I usually perform when I am writing code is grepping the code for a certain string. In order to do that, I used to exit Vim (either with :q or suspending the process), grep the files and then go back to my Vim session. This approximation has one main drawback: I usually don’t remember all the matches reported by grep.
Vim provides a mechanism for invoking grep from a Vim session. The command is:
:grep string files
This way, one can invoke his local grep command and the results will be integrated into the error list, the one we wrote about in compilation errors. This way, one can move through the matching list using both
We can instruct Vim to use another grep program by setting the grepprg variable.