reddit / emacs

How do you set iedit's cursors to work on a region without narrowing it first?

vfclists · 2022-05-21 18:14
I've just been introduced to iedit and when I used it in a region I have to narrow to the region before selecting the texts to change. Is there some way to get it work in a some area without marking it first? Some of the demos I've seen don't seem to narrow the region before using it, unless I'm missing something?
Phil-Hudson · 2022-05-21 19:15
Use the universal prefix argument (`C-u` in vanilla Emacs).
vfclists · 2022-05-22 16:33
Your hint was terse but I managed to work it out. Select a sample of the text you want to replace then `C-; C-;` - ie toggle the `iedit` command. Select the region you want to apply the previous `iedit` selection to , then `C-u C-;`. All strings which match the previous selection will be selected. You can then select any of them to start editing on, and modifying it will change the others. Is there something I'm missing?
vfclists · 2022-05-24 18:02
For those interested in other options [Emacs stack exchange](https://emacs.stackexchange.com/questions/13466/how-to-replace-words-in-a-region-using-iedit) has some more info