Answers:
的
:帮助注册
命令显示有10个编号的寄存器("0
至"9
)。
登记"0
是最近被拉扯的东西; register "1
具有最近删除的文本,register "2
先前的删除,"3
之前具有的删除,依此类推。
如果删除各行依次寄存器"1
,"2
,"3
和"4
将含有“Vim的”,“和”,“世界”和“你好”,分别。
您可以使用:reg
(或:registers
)命令对此进行验证:
:reg
"" Vim^J
"1 Vim^J
"2 And^J
"3 World^J
"4 Hello^J
因此,一次删除四行后,您可以恢复第二行(“世界”)
"3p
因为它是第三次删除。
:help registers
。非常有用
d
4次,而不是dd
),则除最后一个删除的单词之外的所有单词都将丢失。
除了njd的答案外,还可以使用YankRing插件简化此操作。除了使浏览先前的yanks更容易之外,您还可以配置一些键以允许将先前的yanks弹出“堆栈”。这使您可以执行以下操作:
yy " Copy first line
yy " Copy second line
yy " Copy third line
yy " Copy fourth line
" Assumes you've mapped ,p to be the pop command: choose your preferred key or key-combination
,p " Paste fourth line and pop it off the Yank Ring
,p " Paste third line and pop it off the Yank Ring
,p " Paste second line and pop it off the Yank Ring
,p " Paste first line and pop it off the Yank Ring
,p
以弹出上一个洋基?