Skip to content

Instantly share code, notes, and snippets.

@gzagatti
Last active July 23, 2018 16:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gzagatti/3b652abf560d52e289d3f9b2b79293af to your computer and use it in GitHub Desktop.
Save gzagatti/3b652abf560d52e289d3f9b2b79293af to your computer and use it in GitHub Desktop.
Change multiple files at once in Vim.
set aw
" There are two different approaches for finding the target files
" execute "args" join(systemlist("ag -l pattern path/to/files"), " ")
args `ag -l pattern path/to/files`
argdo %s/pattern/new/g | w
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment