There is a way to replace all cases of a string in files in Vim using a combination of the args and argdo commands . Unfortunately, there is a drawback to this solution: it will open all files that may be a problem for large projects. Does anyone know a more compact and efficient way of memory?
find projectfolder -type f -exec grep -Iq 'pattern' {} \; -exec vim {} +
Here's how I do it (when I'm not using perl):
perl
find . -name '*.java' -exec vim +'%s/OldName/NewName/gc' +'wq' {} \;
i.e. replace "OldName" with "NewName" in all "* .java" files, but ask for confirmation for each lookup.