有两种方法。我认为你可以选择矩形并在所有行的开头和结尾添加内容。
我还想知道是否可以选择多个点,这些点相对于您编辑的位置具有不同的偏移量,并同时编辑所有点。我认为Yasnippet提供了类似的功能,但仅当您使用预定义的模板时才能使用。类似于这样。
<div class="">
<a class="">
我能帮助你翻译这段内容。这段话询问是否可以在两个类上标记一个点,使得编辑时能够同时更改这两个类的属性。请问这个做法可行吗?
《Emacs Rocks!》介绍了mark-multiple,它可以满足您的需求。 (这是他们的视频介绍 。)
编辑:@Lifton 指出,它已被multiple-cursors取代。
multi-select
来满足你的需求。以下是示例用法(第一个示例将提供我认为你想要的内容): C-u C-M-m w foo <RET> <RET>
- inserts/prepends "foo" to every multi-selection (you can also append or replace text)
C-u -1 C-M-m r <pre>\(\w+\).+\s-+\(.+\)</pre>
- selects first and last word of the contents every <pre> tag
(provided the contents don't span multiple lines)
C-M-m x M-x upcase-region
- converts all multi-selections in buffer to uppercase
C-u M-w C-q C-j --- C-q C-j <RET>
- saves all multi-selections to kill-ring as a single item,
with selections separated by "---" on a line by itself
multiple-cursors
取代(看起来它仍在开发中)。 - Liffon