Skip to content

Command.hotkeys?

Command › hotkeys?

Official

Type: Hotkey[]

Sets the default hotkey. It is recommended for plugins to avoid setting default hotkeys if possible, to avoid conflicting hotkeys with one that's set by the user, even though customized hotkeys have higher priority.

Example:

this.addCommand({
id: 'example-command',
name: 'Example command',
// WARNING: as per comment above, it's not recommended to set default hotkeys
// this example is just for syntax demonstration purposes, not the recommended way to do it
hotkeys: [{
modifiers: ['Mod', 'Shift'],
key: 'l',
}],
});