插入(通过粘贴)多行文本后有没有办法移动光标?在进行内联插入(粘贴)时,p
效果P
很好。但是如果我粘贴多行文本,我的光标会不管p
或P
移动到新文本的顶部。
如何在p
or之后的新文本之后离开我的光标P
?
插入(通过粘贴)多行文本后有没有办法移动光标?在进行内联插入(粘贴)时,p
效果P
很好。但是如果我粘贴多行文本,我的光标会不管p
或P
移动到新文本的顶部。
如何在p
or之后的新文本之后离开我的光标P
?
使用标记是一种方法。但是对于p or P
,如果你想在新粘贴的文本之后离开你的光标,有内置的gp
:h gp
详情
["x]gp Just like "p", but leave the cursor just after the new
text. {not in Vi}
["x]gP Just like "P", but leave the cursor just after the new
text. {not in Vi}
您想使用]
标记移动到粘贴文本的末尾。这段摘录来自:help ']
:
After executing an operator the Cursor is put at the beginning of the text
that was operated upon. After a put command ("p" or "P") the cursor is
sometimes placed at the first inserted line and sometimes on the last inserted
character. The four commands above put the cursor at either end. Example:
After yanking 10 lines you want to go to the last one of them: "10Y']". After
inserting several lines with the "p" command you want to jump to the lowest
inserted line: "p']". This also works for text that has been inserted.