Skip to content

hotkeys

const hotkeys: object

Defined in: src/core/hotkeys.ts:314

Imperative hotkey API.

const dispose = hotkeys.register({
key: "ctrl+s",
name: "Save",
description: "Write the current buffer to disk",
group: "File",
handler: () => save(),
});
hotkeys.setContext("editor"); // activate editor-scoped bindings

groups: (opts?) => HotkeyGroup[]

Active hotkeys grouped by section.

ListOptions

HotkeyGroup[]

list: (opts?) => Hotkey[]

Active hotkeys matching the options.

ListOptions

Hotkey[]

popContext: () => void

Leave the innermost context.

void

pushContext: (context) => void

Enter a nested context.

string

void

register: (opts) => () => void

Register a hotkey; returns a disposer.

HotkeyOptions

() => void

setContext: (context) => void

Replace the context stack with one context (or none).

string | null

void

get context(): string | null

The active context, or null.

string | null