Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

vim - move cursor after inserted text

Tags:

vim

Is there way how to move cursor after inserted (by pasting) multiline text? When doing inline insertion (paste), p and P works just fine. But if I paste multiline text, my cursor regardless of p or P moves to the top of new text.

How can leave my cursor after the new text after p or P?

like image 859
adekcz Avatar asked Feb 26 '26 07:02

adekcz


1 Answers

using mark is one way. but for p or P, if you want to leave your cursor after the newly pasted text, there is build-in gp

:h gp for detail

["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}
like image 133
Kent Avatar answered Mar 01 '26 05:03

Kent



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!