Tag Archives

One Article

Visual Studio Tips

Vim Took over VSCode Keybindings

Posted by matteskolin on

I enjoy using vim in VSCode and VS Proper, however, getting all the keyboard commands to meld between vim and the IDE can be a challenge. I was working the other day trying to do something as simple as find text in the current open file. Cntl + F for find right? Wrong, because in vim Cntl + F is advance forward through the file.

I could use a vim command for find such as ‘/’, but I am so used to Cntl + F, that I wanted to use this instead.

Actually, it turns out for me, most of the vim control key bindings are not important for me, but the normal control bindings are quite critical (copy and paste, select all, find, etc)

In VSCode, there is a setting for Vim to to tell it what keys not to handle. Adding this below to my settings.json greatly improved my workflow in VSCode, while allowing me to continue to use vim.

    "vim.handleKeys":{
      "<C-k>":false,
      "<C-a>":false,
      "<C-t>":false,
      "<C-f>":false,
      "<C-c>":false,
      "<C-v>":false
    },

For more details, see Vim extension documentation.

https://marketplace.visualstudio.com/items?itemName=vscodevim.vim