Skip to content

Instantly share code, notes, and snippets.

@sri
Last active December 24, 2015 13:09
Show Gist options
  • Save sri/6802525 to your computer and use it in GitHub Desktop.
Save sri/6802525 to your computer and use it in GitHub Desktop.
Emacs Search & Replace
Emacs Buffer Search
==================================================
Incremental Search Forward - (default C-s; C-f for me)
Incremental Search Backward - (default C-r; C-f C-r for me)
Regexp Incremental Search Forward (default C-M-s)
Regexp Incremental Search Backward (default C-M-s)
Occur (default M-s o):
Search lines in a buffer matching a pattern and output in another buffer.
Results are clickable.
Emacs Buffer Replace
==================================================
Query Replace (default M-%, C-r for me)
Query Regexp Replace (default M-C-%; C-S-r for me)
- Space or 'y' to replace match
- 'n' to skip to next
- ',' to replace but not move point
- '!' to say yes to all
- '^' to move back to previous match
- 'E' to edit replacement string
Emacs Replace Across Files:
==================================================
http://stackoverflow.com/questions/270930/
using-emacs-to-recursively-find-and-replace-in-text-files-not-already-open
- M-x find-name-dired
- Hit t to "toggle mark" for all files found.
- Hit Q for "Query-Replace in Files...".
- Same interfaces as query-replace-regexp.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment