Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

vim

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?

like image 850
Ethan Zhang Avatar asked May 26 '12 16:05

Ethan Zhang


1 Answers

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.

like image 95
Benoit Avatar answered Oct 20 '22 17:10

Benoit