4

I have a set of keybindings in package.json,

{ "command": "md.image", "key": "Ctrl+Shift+i" }, { "command": "md.codeblocks", "key": "Ctrl+Shift+B" } 

This has a problem with other global keyboard shortcuts in vscode, I want to have this overridden in the extension so these keyboards act as the current keyboard mappings for the language its loaded for.

Is this possible?

2 Answers 2

3

In case anyone runs into the same specific example of this that I ran into:

I was trying to use the Ctrl+F command to go forward with the Vim extension in VS Code.

I tried unsuccessfully putting a config with unset! in keybindings.json.

However I found that "vim.useCtrlKeys": true in settings.json allows these sorts of ctrl keys to work in the Vim extension with no other changes necessary.

Sign up to request clarification or add additional context in comments.

Comments

2

You can disable existing shortcuts by adding a keybinding entry and prefixing its command with a -. For example, to disable the builtin global shortcut for ctrl+n, add the following entry:

{ "key": "ctrl+n", "command": "-cursorDown", "when": "textInputFocus" } 

You can find the default global entries by selecting "Preferences: Open Default Keyboard Shortcuts (JSON)" from the Command Palette.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.