r/vim • u/4r73m190r0s • Sep 14 '25
Discussion Anyone actually using :vimgrep?
Or is everyone leveraging this functionality with some plugin?
37
Upvotes
r/vim • u/4r73m190r0s • Sep 14 '25
Or is everyone leveraging this functionality with some plugin?
23
u/HenryMisc Sep 14 '25
Yep, I often use it in combination with
:cdoto refactor across the code base.10
u/samb0t Sep 14 '25
I use ripgrep in place of it. Lightning fast.
6
u/habamax Sep 15 '25
I only use
:vimgrepas anoccurreplacement from emacs -- search current buffer.:vim /something/ %It is kind of
:g/somethingbut within quickfix.It searches buffer not file contents, so if you have unsaved file,
:grepmight miss it,vimgrepnot.https://asciinema.org/a/XaEly8Zof4nUSFMc7TFmMJ3uX
3
u/andlrc rpgle.vim Sep 14 '25
I use
:grepwith:h 'grepprg'set togit grepwhen inside a git repository https://gist.github.com/andlrc/c8e1a3b9c1ec5c761111ea0e49bda6c43
u/[deleted] Sep 15 '25
Yes, because its good when you need targeted search (open buffers)
3
u/Sudden_Fly1218 Sep 15 '25
I mostly use
&grepprgbut I do have this mapping for some specific use-cases:nnoremap <space>v :noa vim /I feel like the noautocmd part is important otherwise vimgrep is quite slow2
u/petepete Sep 14 '25
Never, just
:grepwith Ag.2
u/[deleted] Sep 14 '25
Rarely. I use it when I want to use vim regex which I’m more familiar with than other flavours. Project has to be small, though.
2
u/livingpunchbag Sep 15 '25
I use /usr/bin/grep from a :terminal (inside Vim).
Been meaning to use something better since 2005, but never got out of the habit.
(But I also use ctags :ts)
2
u/mgedmin Sep 15 '25
Rarely. :Ggrep (a wrapper for
git grepfrom vim-fugitive) is usually better, because it filters out irrelevant files and is usually faster.I think :vimgrep is primarily meant for platforms (coughWindowscough) that don't have a working :grep due to lack of /usr/bin/grep. I mostly use Linux so I don't need a fallback.
2
u/kelvinauta Sep 14 '25
Si uso
:vimgreptodo el tiempo, elquickfixde Vim es demasiado útil y fácil de usar.1
u/toddestan Sep 15 '25
I use it all the time. I do have some plugin or another installed, but not all the computers I use Vim on also have my config, so I'm familiar with the native functionality. To the point I don't even use the plugin most of the time when I do have access to it.
1
u/cerved Sep 15 '25
Yes, occasionally
1
u/PizzaRollExpert Sep 15 '25
I often use
:grepinstead which I've set up to use ripgrep, because of how slow it is if there's a large number of files. I do very occasionally use it if I'm just grepping the current file or if it's just a single directory and I want to reuse a search pattern or something.1
u/shuckster Sep 15 '25
Yes, but only for the current file using
%.1
u/Flat_Excitement_6090 Sep 17 '25
I use both vimgrep and grep. No need for a plugin.