October 2015
Intermediate to advanced
356 pages
7h 54m
English
| Tip 97 | 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 few of Vim’s primitive commands that operate with the quickfix list.
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 to working with Vim. |
| | |
| | credits.txt |
| | Pragmatic Vim is written ... |