News for hackers. Stuff that matters.
Re:Reasons To Give The Vim Text Editor A Chance by ericb on Sunday May 15, 2011 @08:39PM (#2551224)
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).
Re:Reasons To Give The Vim Text Editor A Chance by rbright on Sunday May 15, 2011 @09:45PM (#2551331)
Try 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.
Re:Reasons To Give The Vim Text Editor A Chance by crowsfan85 on Monday May 16, 2011 @05:56AM (#2552087)
I agree. I've also found this perl script handy for recursive find/replace: http://www.neilgunton.com/doc/deep

$ deep replace "foo" "bar" "*.html"