I find bulk find-and-replace to be too risky or fuzzy for me. I prefer to go match-by-match and confirm the replace. My approach is usually something like:
git grep -l something-regexp | xargs nvim
Which will open vim with every file that matched that regexp, and then I can do a traditional find/replace flow on each file.
I find bulk find-and-replace to be too risky or fuzzy for me. I prefer to go match-by-match and confirm the replace. My approach is usually something like:
Which will open vim with every file that matched that regexp, and then I can do a traditional find/replace flow on each file.
The article talks about using the
cflag on vim substitutions to have it ask for confirmation on each case.e.g.
:%s/foo/bar/gcwill do a global search and replace with confirmation