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?
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With