You’re free to make what ever changes you like, Emacs will reflect the changes you’ve made back into the source buffer when you type C-c C-c.Įxceptionally powerful, and works well with keyboard macros or advanced search and replace.Ĭombine with M-x multi-occur-in-matching-buffers for bulk editing across a range of buffers. One blow-your-mind feature is editable Occur! M-x occur-edit-mode (also bound to e) engages the edit mode in Occur. Set it to 2, and you’ll see the preceding and following two lines of each match Occur finds. If you customize list-matching-lines-default-context-lines you can tell Emacs to show contextual lines around the match. In a similar vein, you can enable follow mode in the *Occur* buffer by pressing C-c C-f, and future calls to M-n and M-p in the *Occur* buffer will automatically jump to the correct match in the source buffer. Combine it with keyboard macros and you can build a sophisticated tool capable of processing an arbitrary amount of data, provided you source your matches for the keyboard macro by jumping to the next or previous match. The latter is useful if you combine it with M-x auto-revert-tail-mode in the buffer(s) that you’re searching.Īnother useful feature is its support for the compilation mode commands next/previous-error ( M-g M-n and M-g M-p, respectively), as you can step through the matches one by one. You can also re-run the occur command by pressing g in the output buffer. When you do use Occur, you can tell it to rename the buffer (if you desire more than one open Occur buffer) by pressing r. Both work well for that purpose, but they do require that you specify what you want Occur to search for. If you want to match against multiple buffers you must use the sibling commands M-x multi-occur or M-x multi-occur-in-matching-buffers. The Achilles’ heel is that it only works on a single buffer.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |