Project-wide search and replace in Vim with Qargs

Project-wide search and replace in Vim is a bit clumsy, but with vim-qargs it’s a bit easier to pull off.

Suppose that you want to replace all foo with cliché bar. With Qargs you can do this in the following way:

:Ag foo -w app/ -G .js$

ag, grep or any searcher keeps found terms in quickfix list. In order to fire the replacement (with %S/foo/bar) first you have to move the found terms to argument list-you cannot operate on quickfix this way.

argdo %S/foo/bar/gc | update

For convenience you can pull it off in two steps:

:Ag foo -w app/ -G .js$
:Qargs | argdo %S/foo/bar/gc | update

That’s ‘it’.
This protip has been written in 834 seconds