如何使用标记(非视觉选择)复制到vim上的系统剪贴板?

时间:2016-07-21 18:52:39

标签: vim

从vim复制到系统剪贴板的

Most methods涉及使用视觉选择。我不想这样做,因为我必须复制跨越多个屏幕的文本。我使用标记的速度更快。

如果我只是在划线,我会这样做:

/<<<<< # find the beginning of my diff
ma     # set mark `a` to the current position
/===== # find the end of my diff
y'a    # yank all lines between the current position and mark `a`.

我认为y'a可以通过某种方式进入特定的寄存器,或者从unnamed register转移到选择寄存器*

1 个答案:

答案 0 :(得分:1)

你可以这样做:

:'a,.y *

或(更短):

:'a,y *

请参阅:help :y