3 ms·
What about project-wide find and replace? I have been looking to switch to vim, but I do this fairly often and don't see anything that compares to what a good i
by ericb 15y ago
What about project-wide find and replace? I have been looking to switch to vim, but I do this fairly often and don't see anything that compares to what a good ide can do in vim (without bash command madness).
- rbright 15y agoTry bufdo, argdo, windo, and tabdo depending on the subset of files you'd like to modify. E.g., to replace "foo" with "bar" in all open buffers: :bufdo %s/foo/bar/g | update Although I wouldn't knock `bash command madness' for this sort of task. :) The Unix shell is pretty much designed for advanced text manipulation across files. E.g., to replace all instances of foo with bar in HTML files, recursively: $ find . -name '*.html' -exec perl -i -lpe 's/foo/bar/g' {} \; vim and the shell are not so far apart and complement each other well, so it pays to understand them both.
- crowsfan85 15y agoI agree. I've also found this perl script handy for recursive find/replace: http://www.neilgunton.com/doc/deep http://www.neilgunton.com/doc/deep $ deep replace "foo" "bar" "*.html"