Emacs: interactive regexp search and replace across multiple files
Published 24 November 2013
Here’s how to use Emacs to for an interactive search and replace across multiple files.
- Open a
diredbuffer containing the files to be searched. An easy way to list files in all subdirectories is with
- Mark the files that you want to search with
- Run the multi-file search and replace with
yto accept a replacement and
nto skip it.
- Afterwards, you need to save all the modified buffers. Open
M-x ibufferthen press
* uto mark unsaved buffers, and
Sto save them.