1

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?

2
  • "+y works for me on X. No configuration needed.
    – Andy
    Commented Nov 19, 2021 at 12:52
  • That's nice, but I'd like y go to X directly. Commented Nov 22, 2021 at 8:44

1 Answer 1

1

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
3
  • 1
    Wouldn'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.
    – Andy
    Commented Nov 24, 2021 at 2:42
  • Just to be clear, i don't recommend overriding the default vim's y and p, I would suggest to map it to something like Ctrl-C for copy and Ctrl-V for paste
    – Andy
    Commented Nov 24, 2021 at 2:44

Not the answer you're looking for? Browse other questions tagged or ask your own question.