Reputation: 4479
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?
Upvotes: 24
Views: 4230
Reputation: 79155
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.
Upvotes: 48