Vim-目视选择多个非连续部分

Vim-目视选择多个非连续部分,vim,textselection,Vim,Textselection,VIM中是否有一种方法可以直观地选择文档中未直接连接的多个部分/非连续行? 我的目标是将文档的某些部分复制到不同的部分,在当前VIM实例的不同缓冲区中打开。然而,同样的程序也可用于删除此类选择。 假设在下面的示例中,我想选择第2、6和11行 1全球主要 2外部打印f 三, 第4节.案文 5_main: 6推送消息 7呼叫打印F 8添加esp,4 9 ret 10信息: 11分贝“你好,世界”,10,0 感谢@Andrea Baldini的Highlight of a,我看到了一个解决我问题的可行

VIM中是否有一种方法可以直观地选择文档中未直接连接的多个部分/非连续行? 我的目标是将文档的某些部分复制到不同的部分,在当前VIM实例的不同缓冲区中打开。然而,同样的程序也可用于删除此类选择。 假设在下面的示例中,我想选择第2、6和11行

1全球主要

2外部打印f

三,

第4节.案文

5_main:

6推送消息

7呼叫打印F

8添加esp,4

9 ret

10信息:

11分贝“你好,世界”,10,0


感谢@Andrea Baldini的Highlight of a,我看到了一个解决我问题的可行方案,它不需要任何插件。 为了便于参考,我复制了@soulmerge的回复

To start the 'Accumulation Buffer':
    1. mark a section to copy in visual mode,
    2. press "a to operate on the buffer a with the next command and
    3. yank it as usual (y).
To add to that buffer:
    1. mark the next section and
    2. press "A (capitalizing the buffer name means "do not overwrite the buffer, append to it instead")
    3. and yank again using y.
You can then paste the accumulated buffer a at any time using "ap.

抱歉,这听起来像是对原来的问题的离题,这个问题是明确以vim为中心的,但是对于这种涉及非连接多个选择的任务,Kakoune可能是适合这项工作的工具。看看这里:感谢@AndreaBaldini找到了我没有找到的答案。其中一个答案中的累积缓冲区概念对我来说非常可行。