cursor position after pasting in vi / vim
In vim, use gp
and gP
instead of p
and P
to leave the cursor after the pasted text. If you want to swap the bindings, put the following lines in your .vimrc
:
noremap p gp
noremap P gP
noremap gp p
noremap gP P
Strangely, in vim, p
and P
leave the cursor on the last pasted character for a character buffer, even in compatible mode.
I don't know how to change this in other vi versions.