Keymaps
A command may have a corresponding keyboard shortcut. You can define key bindings for commands in keymap JSON files like below:
{ "ctrl-n": "application:new", "ctrl-c": "edit:copy", ...}Key binding should be a combination of following keys with - separator.
- Character literals :
a,1,,, … - Modifier keys :
ctrl,cmd,shift,alt,cmdctrl(cmdctrlis automatically recognized incmdin MacOS andctrlin Windows and Linux andaltis corresponds to option key in MacOS) - Special keys :
enter,space,up,down,left,right,delete,tab,backspace,plus,minus,f1…f12
The key bindings is shown in menu items of the same commands automatically. If two or more extensions bind the same key, the extension loaded later wins.
The keymap JSON files should be placed in keymaps/ folder of the extension and the keymap files are loaded in alphabetical order.
my-extension/└─ keymaps/ └─ keymap.json