4

I am using VisualStudioCode with the extension VsCodeVim Version 1.10.2.

Ctrl + v is mapped to select region and I don't know what Ctrl + c does. It does not change the copy buffer, because when I paste into another application, it pastes the ??previous?? clipboard contents.

I was able to copy/paste with the Edit-Menu and Right-Click menu. So my question is:

How can the keyboard shortcuts for copy/paste be accessed/enabled?

kenlukas
  • 3,616
  • 9
  • 25
  • 36
Mike Mestnik
  • 313
  • 5
  • 14

2 Answers2

3

Adding the following lines to your settings.json disables the handling of Ctrl + C, Ctrl + V and Ctrl + X by VsCodeVim.

"vim.handleKeys": {
    "<C-c>": false,
    "<C-v>": false,
    "<C-x>": false,
},

Without these lines Ctrl + C works for me when selecting words via 'VISUAL' mode. I can now use Ctrl + V to paste the clipboard into any other editor. Or I can use Ctrl + Shift + V to paste into VsCode Editor without entering 'INSERT' mode. But when in 'INSERT' mode Ctrl + C will not work, since Ctrl + C will normally abort any commands. Ctrl + V on the other Hand works as usual.


Note: I tested this with Visual Studio Code Version 1.38.1 and VsCodeVim Version 1.10.2

Martin Backasch
  • 1,829
  • 3
  • 20
  • 30
0

You have to be in INSERT mode, for Ctrl-Shift-v to paste.

From normal mode, Ctrl-v enters block visual mode, if you want char or line visual mode you use v and Shift-v respectively... Then presumably copy and cut with Ctrl-Shift-(c/x) would work.

Alternatively you can try this suggestion.

Mike Mestnik
  • 313
  • 5
  • 14