I only want to use normal mode and visual mode of vim in vscode

2.4k Views Asked by At

Currently I'm new to vim so I installed https://marketplace.visualstudio.com/items?itemName=vscodevim.vim in vscode to get accustomed of vim.

I want to disable insert mode of vim in vscode because as insert mode is enabled in vscode, the many shortcut keys of vscode is disabled. For instance Ctrl+j in vscode open a terminal however this operation is not adopted since vim also has same keybinding. Quite annoying.

I viewed content of ~/.vscode/extensions/vscodevim.vim-1.20.2/package.json however seemingly there is no way to only disable insertmode in vscode.

Or is there some way which takes priority of effect of shortcut key of keybinding of vscode than vim one?

What should I do for next?Or can it even able to do that?

2

There are 2 best solutions below

0
AudioBubble On BEST ANSWER

Not a complete solution however this is the one of the provisional solutions.

Add the following inside ~/.config/Code/User/settings.json

 "vim.handleKeys": {
    "<C-j>": false,//keybinding of vim which you want to disable
  }
0
Mikkel On

I started configuring my VSCode vim setup using the shortcuts GUI. If you simply search for a key combination, eg. "ctrl+j" (with quotation marks) in the search bar in the shortcuts tab, you can find exactly what is capturing what input. This is what that looks like for me. The way to disable vim shortcuts is then to simply remove the preconfigured vim shortcut keybinding from the vim extension (you can always reset it back). This is what looking up vim binds can look like. The other solution is probably the "better" solution, but this method can be useful for way more than just vim binds, so its what I use.