开发者

How to edit multiple strings in emacs at sametime?

开发者 https://www.devze.com 2022-12-22 07:18 出处:网络
I want edit mu开发者_开发技巧ltiple 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.

I want edit mu开发者_开发技巧ltiple 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?


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


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


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号