Find and Replace Across files in Vim
Here's a simple way to do a find and replace across files in vim:
Load all the files you want to edit into vim:
Ag "pattern" -l | xargs vim -
Here I'm using
ack replacement: https://github.com/ggreer/the_silver_searcher to get a list of files that contain the text I want to change.
Next, run the following in the newly opened vim window:
:argdo %s/pattern/substitution/gce | update
Omit the "c" in the search options if you don't want to confirm each replacement.