Created
January 6, 2016 18:12
-
-
Save joshuaborn/5eb74f025c37c20d138c to your computer and use it in GitHub Desktop.
Find and replace across files in Vim
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function GlobalFindReplace(target, replacement) | |
execute "arg `ag -l " . a:target . "`" | |
execute "argdo % s/" . a:target . "/" . a:replacement . "/gc | update" | |
endfunction | |
command -nargs=* Gfr call GlobalFindReplace(<f-args>) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment