Search code examples
vscodevim

How to keep selection on copy with VSCodeVim


When I select code in visual mode or with the mouse and then press Cmd+C, I lose the selection.

This does not happen when VSCodeVim is turned off.

How do I have to configure VSCodeVim to keep the selection on pressing Cmd+C?

I already tried the following options to no avail:

"vim.useSystemClipboard": true,
"vim.useCtrlKeys": true,
"vim.handleKeys": {
  "<C-c>": false,
},

Solution

  • You have to make VSCodeVim ignore <D-c>, not <C-c>. D is the name of the Cmd key in the settings.

    "vim.handleKeys": {
      "<D-c>": false,
    },