Emacs kaizen: helm-swoop and editing

This entry is part 2 of 4 in the series Emacs Kaizen

Continuing on this quest to focus on one tiny little workflow change at a time, so that I can get even better at using Emacs…

One of those packages I installed but never got around to trying out was all, which lets you interactively edit all lines matching a given regular expression. It’s like an editable occur, sorta.

It turns out that helm-swoop lets you use C-c C-e to edit matching lines interactively (so you can use keyboard macros or replace-regexp or whatever). You can type C-x C-s to save it back to the buffer.

On a related note, I’m still tickled pink every time I use dired-toggle-read-only (C-x C-q) to make a Dired buffer editable so that I can batch-rename filenames.

Series Navigation« Emacs: M-y as helm-show-kill-ringEmacs kaizen: ace-isearch combines ace-jump-mode and helm-swoop »

2 Pingbacks/Trackbacks

  • Have you tried using `multiple-cursors’ and if so how does it compare to `all’?

    • TobyHaynes

      The nice thing about ‘all’ is that it brings all the lines you are interested in editing into a smaller buffer than the original. In many cases, this will now fit entirely in the frame. I’ve occasionally run into trouble with mc/mark-all-like-this where I started editing something I didn’t intend to and couldn’t see at the current frame position.

      • When you have multiple active cursors, if you hit C-‘ it will hide lines that don’t have an active cursor.

      • I like helm-swoop for that too; the overview is helpful. Also, having an editable buffer means I can make slightly-different tweaks to each line. I use multiple-cursors if the changes that I want to make are identical across lines. =)

      • Nice to know, thanks.

    • milkypostman

      Can you use `multiple-cursors` inside the swoop buffer?

  • codemac

    You can just press the `e’ key in occur mode? or does this do something different?

  • Pingback: Narrow your view on multiple-cursor marks | Wisdom and Wonder()

  • Pingback: Narrowing with Multiple Cursors | Irreal()