Batch Replace in Vim

Adler @ 2019-06-06


Locate terms in files, e.g. "Sam":

:vimgrep /Sam/gj **/*

It will end without prompt. Open the list for confirmation with:

:copen

Replace "Sam" with "Bob" and save:

:cfdo %s/Sam/Bob/g | update

Reference