如何在emacs中同时编辑多个字符串?
我想通过选择需要编辑的字符串列表来一次编辑多个字符串。选择后,当我键入时,它应该修改所选字符串中的所有文本。
如何实现多字符串编辑?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我真的很喜欢
iedit.el
,它突出显示了所有字符串的出现次数,并显示您所做的修改。I really like
iedit.el
, which highlights all the occurrences of the string, and shows you the modifications as you make them.替换字符串或查询替换引用 Emacs 手册。
replace-string or query-replace quoth the Emacs manual.
您想要 Per Abrahamsen 的“all.el”:
本质上,您说
M-x all RET 模式 RET,
然后编辑 All 中的匹配项。该缓冲区中所做的更改将传播回原始缓冲区。
我个人觉得这比 iedit 方便得多,但是 YMMV。
很难找到 all.el 的源代码,因此我将其粘贴到此处。
You want "all.el" by Per Abrahamsen:
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.