vim

Yank a region in VIM without the cursor moving to the top of the block?


Is there a simple way (i.e. without writing a script or elaborate keymap sequence) to Yank a group of lines and leave the cursor wherever the Yank was performed, as opposed to at the start of the block?

According to :help blockwise-register:

Note that after a characterwise yank command, Vim leaves the cursor on the first yanked character that is closest to the start of the buffer.

Line-wise seems to behave similarly.

This is a bit annoying for me since I tend to select a large region from top to bottom, Yank, and then paste near or below the bottom of the selected region. Today I'm setting a mark (m-x) just before Yank and then jumping back, but I suspect there may be a different Yank sequence that will do what I need.


Solution

  • Not quite answering your question, but perhaps '] would solve your problem?

     ']  `]         To the last character of the previously changed or
                    yanked text.  {not in Vi}