Keybindings
Command Code works beautifully the moment you open it - every shortcut is set up the way most people expect. But your hands are your own. If you live in Emacs, or you reach for Vim motions without thinking, or you just prefer a different key for one thing, you can make Command Code match your muscle memory.
Shortcuts live in a single file, ~/.commandcode/keybindings.json. It's optional -
create it only when you want to change something. Anything you don't mention keeps
its default, so you're always adjusting, never starting from scratch.
Made an edit mid-session? Run /reload and your changes take effect right away -
no need to close and reopen.
Each shortcut is a modifier and a key, joined with a plus sign - ctrl+a,
alt+left, shift+enter. You can stack modifiers (ctrl+shift+k), and the order
never matters: ctrl+shift+k and shift+ctrl+k mean the same thing.
The three modifiers are Control (ctrl), Shift (shift), and Option
(alt - you can also write option or meta, whichever feels natural on your
keyboard).
For the key itself, use a letter (a–z), a number (0–9), a symbol, or one
of the named keys: up, down, left, right, home, end, pageUp,
pageDown, enter, escape, tab, space, backspace, delete, insert.
Give an action a single shortcut, or a list of them when more than one should work:
Each action has a stable name - a short, dotted id you'll use in the file. Here's the full set, grouped by where they act.
Moving the cursor
| Action | Default | What it does |
|---|---|---|
tui.editor.cursorLeft | left | Move left one character |
tui.editor.cursorRight | right | Move right one character |
tui.editor.cursorUp | up | Move up one line |
tui.editor.cursorDown | down | Move down one line |
tui.editor.cursorWordLeft | alt+left, ctrl+left, alt+b | Jump back a word |
tui.editor.cursorWordRight | alt+right, ctrl+right, alt+f | Jump forward a word |
tui.editor.cursorLineStart | home, ctrl+a | Go to the start of the line |
tui.editor.cursorLineEnd | end, ctrl+e | Go to the end of the line |
Editing text
| Action | Default | What it does |
|---|---|---|
tui.editor.deleteCharBackward | backspace | Delete the character behind the cursor |
tui.editor.deleteCharForward | delete | Delete the character ahead of the cursor |
tui.editor.deleteWordBackward | ctrl+w, alt+backspace | Delete the word behind the cursor |
tui.editor.deleteToLineStart | ctrl+u | Clear back to the start of the line |
tui.editor.deleteToLineEnd | ctrl+k | Clear forward to the end of the line |
Composing a message
| Action | Default | What it does |
|---|---|---|
tui.input.newLine | shift+enter, ctrl+j | Add a line break instead of sending |
tui.input.submit | enter | Send your message |
Working with the session
| Action | Default | What it does |
|---|---|---|
app.permission.cycle | shift+tab, alt+m | Switch permission mode: default, auto-accept, then plan, cycling back to default. Launched with --yolo, bypass joins as a fourth rung (plan → bypass → default). (alt+m covers Windows terminals where Shift-Tab doesn't come through.) |
app.tools.expand | ctrl+o | Show or hide the full tool output |
app.model.select | alt+p | Jump to the model picker (Option-P on a Mac) |
app.todos.toggle | ctrl+x | Open the session todo manager (the /todos overlay); press again to close |
app.editor.external | ctrl+g | Hand the prompt off to your editor ($EDITOR) |
app.input.stash | ctrl+s | Set the current prompt aside, then bring it back |
app.interrupt | escape | Stop what's running |
app.clipboard.pasteImage | ctrl+v | Drop in an image from the clipboard |
On a permission prompt
When Command Code stops and asks you to approve a tool call, press ctrl+e
(ctrl+y in VS Code-family terminals, where the IDE intercepts ctrl+e) to get an on-demand, plain-language
explanation of what the command will do before you decide. This shortcut is
part of the permission prompt itself, not a keybindings.json action, so it
isn't listed in the bindable table above and can't be remapped.
Prefer Emacs motions across the input line? Add its bindings alongside the defaults:
Or lean on Vim's home-row motions with Option held down:
- Nothing to break: If the file is missing, or a line has a typo, Command Code quietly falls back to the defaults and starts as usual. A single bad entry never takes the rest of your file down with it.
- Coming from an older setup? Earlier configs used shorter names like
cursorUporexpandTools. Command Code recognizes those and updates them to the dotted ids for you, automatically, on launch. - Want a key to do nothing? Set the action to an empty list (
[]) to clear it. - Your terminal is covered: Home, End, and Option-Arrow arrive as different sequences across iTerm2, Terminal, Ghostty, Kitty, Alacritty, WezTerm, and VS Code - Command Code understands them all, matching the defaults above out of the box.
- Check what's live. Run
/hotkeysany time to see your effective bindings, including overrides fromkeybindings.json.