Vim icon indicating copy to clipboard operation
Vim copied to clipboard

Visual mode paste should not necessarily yank deleted text

Open guillaumeboehm opened this issue 3 years ago • 1 comments

Is your feature request related to a problem? Please describe. When pasting in visual mode the clipboard is overridden by the deleted content, this is very annoying when trying to paste the same content several times.

Describe the solution you'd like Having the option to not override the clipboard on paste.

Describe alternatives you've considered The only workaround that I could find was to map the visual mode paste command to editor.action.clipboardPasteAction but this doesn't seem to be working anymore (the paste doesn't take the selection in account).

guillaumeboehm avatar Jul 06 '22 08:07 guillaumeboehm

Vim 9 has a new feature that seems to solve this exact problem.

https://vimhelp.org/version9.txt.html

Add the 'P' command in visual mode to paste text in Visual mode without yanking the deleted text to the unnamed register. put-Visual-mode

https://vimhelp.org/change.txt.html#put-Visual-mode

With P the unnamed register is not changed (and neither the selection or clipboard), you can repeat the same change.

Having support for this standard Vim feature in VSCodeVim would be great.

matecserna avatar Aug 02 '22 11:08 matecserna

Thanks for pointing that out, @matecserna! Neovim appears to behave the same way.

J-Fields avatar Aug 22 '22 00:08 J-Fields