How to jump to the end of pasted content after paste?

℡╲_俬逩灬. 提交于 2020-06-24 20:48:48

问题


For example, my current file conent is:

Hello world!
      ^------------------vim cursor here

Vim cursor is at character w。And I paste a word foobar,the content changed to Hello Hello wfoobarorld, and cursor is at character f. But I want the cursor jump to r of foobar after paste immediately. Is there some command to do that?


回答1:


By default, the p and P commands should leave the cursor at the last character of the pasted text. gp and gP go one character forwards (first character after pasted text).

When you paste text, you have marks [ and ] set to the beginning and end of pasted text. Therefore you can use `[ and `] to move the cursor to begin/end of pasted content.



来源:https://stackoverflow.com/questions/10767960/how-to-jump-to-the-end-of-pasted-content-after-paste

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!