One of the open questions I have about Vim is if there is a way to perform a search/replace in the current project (bear with me if I use this notion inherited from other editors).For instance, let's assume I want to search my project files for a method name, and rename all the instances of that method call.This is how I can proceed with Sublime.How would you do this in Vim (possibly MacVim) without relying on other programs such as ack or sed?
Vim search replace all files in current (project) folder
search;macvim
There are several ways to do this.Inside Current DirectoryIf you want to perform the search/replace in a project tree, you can use Vim's argument list.Simply open Vim and then use the :args command to populate the argument list. You can pass in multiple filenames or even globs.For example, :args **/*.rb will recursively search the current directory for ruby files. Notice that this is also like opening Vim with vim **/*.rb. You can even use the shell's find command to get a list of all files in the current directory by running: :args `find . -type f`You can view the current args list by running :args by itself. If you want to add or delete files from the list, you can use the :argadd or the :argdelete commands respectively.Once you're happy with the list, now you can use Vim's powerful :argdo command which runs a command for every file in the argument list: :argdo %s/search/replace/gHere are some tips for searching (based on some of the comments):Use a word boundary if you wanted to search for foo but not foo_bar. Use the \< and \> constructs around the search pattern like so: :argdo %s/\<search\>/foobar/gUse a /c search flag if you want Vim to ask for confirmation before replacing a search term.Use a /e search flag if you want to skip the pattern not found errors.You can also choose to save the file after performing the search: :argdo %s/search/replace/g | update. Here, :update is used because it will only save the file if it has changed.Open buffersIf you already have buffers open you want to do the search/replace on, you can use :bufdo, which runs a command for every file in your buffer list (:ls).The command is very similar to :argdo:  :bufdo %s/search/replace/gSimilar to :argdo and :bufdo, there is :windo and :tabdo that act on windows and tabs respectively. They are less often used but still useful to know.