arrow placement after pasting in vi/ vim

One point that has actually constantly troubled me in vi/ vim :

If I "tug" (a.k.a. "duplicate") some message, after that relocate to an additional area in the documents and also do a "paste", my arrow continues to be at the start of the message I simply pasted. This is various from what the majority of modern-day editors do, which is placed the arrow at the end of the message I pasted.

As an example, thinking the "duplicate barrier" has words "outstanding" which I intend to paste after words "an" in the expression:

This is an editor

In, as an example gedit , after the paste:

This is an awesome editor
                  ^ Cursor is here

In vi :

This is an awesome editor
           ^ Cursor is here

Can I transform vi to imitate (as an example) gedit hereof?

2019-05-13 05:35:54
Source Share
Answers: 2

I'm rather sure this is deliberately. If you paste making use of "p" (lower instance P), it is intended to paste after the existing placement or line. Nonetheless, if you paste making use of "P" (resources P), after that it pastes prior to the existing placement or line. If your wanted actions is to have the arrow go to completion of your freshly pasted message, attempt entering the behavior of making use of "P" as opposed to "p".

I wager if you dug deep sufficient, you can locate a vim dish to place in your.vimrc that would certainly constantly relocate the arrow throughout of your paste, also if you make use of "p".

2019-05-17 19:46:48

In vim, usage gp and also gP as opposed to p and also P to leave the arrow after the pasted message. If you intend to swap the bindings, placed the adhering to lines in your .vimrc:

noremap p gp
noremap P gP
noremap gp p
noremap gP P

Strangely, in vim, p and also P leave the arrow on the last pasted personality for a personality barrier, also in suitable setting.

I do not recognize just how to transform this in various other vi variations.

2019-05-17 19:02:11