Load Grep Results Into Vim
28 Jun 2025 Tools vimgittipsWhen coding, I often need to search for the references of a variable or a function across multiple files.
Usually I enter command mode of vim and do a grep command,
memorize the search results and open the files having hits.
This common pattern could be dramatically accelerated by a user-defined vim command:
:command Gitgrep :lex system("git grep -n " . shellescape(getreg('/'))).
