Docs
Refer friends. Keep the rewards coming!Your friend can unlock up to 10M tokens · earn up to 30% revenue share.
+500K TokensGenerate link

Keybindings

Keyboard shortcut system for the CrabCode TUI. Defaults plus user customization.

What it is

CrabCode ships with a built-in keybinding engine. Every UI action (submit, undo, autocomplete, confirm, scroll, etc.) has a unique action name that can be bound to one or more key combinations. Custom entries in ~/.crabcode/keybindings.json override the defaults.

When you see this doc

  • Following the keybindings tab from /help inside the TUI
  • While editing keybindings.json

Default core bindings (selected)

Bindings are scoped by context — the same key can trigger different actions in different contexts.

Global

KeyActionDescription
Ctrl+Capp:interruptInterrupt the model; press twice to quit
Ctrl+Dapp:exitQuit
Ctrl+Lapp:redrawRedraw the screen
Ctrl+Tapp:toggleTodosToggle the todo panel
Ctrl+Oapp:toggleTranscriptToggle transcript view
Ctrl+Rhistory:searchSearch session history

Chat (input box)

KeyActionDescription
Enterchat:submitSubmit input
Escchat:cancelCancel / dismiss overlay
/ history:previous / history:nextNavigate input history
Shift+Tabchat:cycleModeCycle interaction mode (falls back to Meta+M on some Windows terminals)
Meta+Pchat:modelPickerOpen model picker
Meta+Tchat:thinkingToggleToggle thinking effort
Meta+Ochat:fastModeToggle Fast mode
Ctrl+_ or Ctrl+Shift+-chat:undoUndo input
Ctrl+G or Ctrl+X Ctrl+Echat:externalEditorOpen current prompt in $EDITOR
Ctrl+Schat:stashStash current input

Autocomplete (popover)

KeyAction
Tabautocomplete:accept
Escautocomplete:dismiss
/ autocomplete:previous / autocomplete:next

Browse the full default set via /help → keybindings tab inside the TUI.

Customize

Edit ~/.crabcode/keybindings.json:

json
{
  "bindings": {
    "chat:submit": ["enter", "cmd+enter"],
    "chat:cancel": ["escape"],
    "app:interrupt": ["ctrl+g"]
  }
}
{
  "bindings": {
    "chat:submit": ["enter", "cmd+enter"],
    "chat:cancel": ["escape"],
    "app:interrupt": ["ctrl+g"]
  }
}

Modifiers: ctrl, cmd, meta, alt, shift. Chords (two-key sequences): ["ctrl+x ctrl+s"] — space-separated means "press these in order".

Limits

  • Reserved keys cannot be rebound: Ctrl+C, Ctrl+D, Ctrl+M (terminals deliver Ctrl+M as Enter, so any binding to it conflicts) — see src/keybindings/reservedShortcuts.ts
  • Keys swallowed by the terminal / OS: Ctrl+Z (SIGTSTP), Ctrl+\ (SIGQUIT) and similar; you can still write a binding, but the event won't reach the app
  • Conflict detection: when duplicate bindings are detected at startup, crabcode --debug logs a warning