views:

88

answers:

3

I want edit multiple strings at once by selection the list of strings needs to edit. After selection, when I type, it should modify all the text in the selected strings.

How to achieve multiple string edit?

+2  A: 

replace-string or query-replace quoth the Emacs manual.

msw
I'm afraid the questioner thinks of a particular TextMate feature. In TextMate when you select a string, it highlights all occurrences of it, and when you edit it, it modifies automatically the others, too.
Török Gábor
@Torok, you are right. Its like textmate feature. since I use emacs, I like to see something similar exists here or not
Gopalakrishnan Subramani
+4  A: 

I really like iedit.el, which highlights all the occurrences of the string, and shows you the modifications as you make them.

Trey Jackson
I've been trying iedit.el out on your recomendation, and I have to say I really like it. One of the most natural-feeling emacs extensions I've used. Thanks.
Singletoned
+1  A: 

You want "all.el" by Per Abrahamsen:

Just like occur, except that changes in the All buffer is propagated to the original buffer.

Essentially you say

M-x all RET pattern RET

then edit the matching occurrences in All. Changes made in that buffer are propagated back into the original buffer.

I personally find this much more convenient than iedit, but YMMV.

It's hard to track down the source code for all.el, so I pasted it here.

sanityinc