Tip 1262 Printable Monobook Previous Next created June 18, 2006 · complexity basic · author Timo Hirvonen · version 7.0 git grep <pattern> searches for a pattern in a currently selected git branch. This adds :G <pattern> command to run the command from within Vim. func GitGrep(...) let save = &grepprg set grepprg=git\ grep\ -n\ $* let s = 'grep' for i in a:000 let s = s . ' ' . i endfor exe s let
![Git grep](https://cdn-ak-scissors.b.st-hatena.com/image/square/909f6e6dbdc89919adbd639ee366a4d2114bc96e/height=288;version=1;width=512/https%3A%2F%2Fstatic.wikia.nocookie.net%2Fucp-internal-test-starter-commons%2Fimages%2Fa%2Faa%2FFandomFireLogo.png%2Frevision%2Flatest%3Fcb%3D20210713142711)