Get the current keybinding mode name.
Current mode name (default: "default")
Register keybindings in the default mode.
app.keys({ "ctrl+s": (ctx) => ctx.update(save), "ctrl+q": () => app.stop(), "g g": (ctx) => ctx.update(scrollToTop),}); Copy
app.keys({ "ctrl+s": (ctx) => ctx.update(save), "ctrl+q": () => app.stop(), "g g": (ctx) => ctx.update(scrollToTop),});
Register multiple keybinding modes (e.g., Vim-like normal/insert).
app.modes({ normal: { "i": () => app.setMode("insert"), "j": (ctx) => ctx.update(moveCursorDown), }, insert: { "escape": () => app.setMode("normal"), },});app.setMode("normal"); Copy
app.modes({ normal: { "i": () => app.setMode("insert"), "j": (ctx) => ctx.update(moveCursorDown), }, insert: { "escape": () => app.setMode("normal"), },});app.setMode("normal");
Switch to a different keybinding mode.
Name of the mode to switch to
Get the current keybinding mode name.