October 2012
346 pages
7h 40m
English
| Tip 96 | Find and Replace Across Multiple Files |
The substitute command operates on the current file. So what do we do if we want to make the same substitution throughout an entire project? Although this scenario is common, Vim doesn’t include a dedicated command for project-wide find and replace. We can get this functionality by combining a couple of Vim’s primitive commands.
We’ll start with a crude but effective solution, and then we’ll look at how it can be refined. As a demonstration, we’ll use the refactor-project directory, which you can find in the source files that come distributed with this book. It contains the following files, reproduced here with their contents:
| | refactor-project/ |
| | about.txt |
| | Pragmatic Vim is a hands-on guide ... |
Read now
Unlock full access