When using the VSCode Neovim extension I would like the default clipboard to sync directly to X, similar to "+y
(as mentioned by How can I get vim yank to clipboard ("*y) working?)
How can I configure Neovim to do it here?
1 Answer
You can use this mapping to automatically copy visually selected text to the system clipboard by pressing y
Add this to your .vimrc
vnoremap y "+y
-
1Wouldn't I have to change paste etc. as well, so the registers align? Commented Nov 23, 2021 at 11:24
-
You can use
nnoremap p "+p
, to paste from system clipboard in normal mode.– AndyCommented Nov 24, 2021 at 2:42 -
Just to be clear, i don't recommend overriding the default vim's
y
andp
, I would suggest to map it to something like Ctrl-C for copy and Ctrl-V for paste– AndyCommented Nov 24, 2021 at 2:44
"+y
works for me on X. No configuration needed.y
go to X directly.