Skip to content

Keybindings

Keyboard shortcuts for Soma's terminal interface.

All keyboard shortcuts are customizable via ~/.soma/agent/keybindings.json. Edit the file, then /reload to apply without restarting. Supports emacs and vim-style bindings.

Default Shortcuts

Essential

ShortcutAction
EnterSubmit message
Shift+EnterNew line in editor
EscapeCancel / interrupt
Ctrl+CClear editor (or copy selection)
Ctrl+DExit (when editor empty)
Ctrl+ZSuspend to background
Ctrl+GOpen in external editor ($VISUAL or $EDITOR)

Models & Thinking

ShortcutAction
Ctrl+PCycle to next model
Shift+Ctrl+PCycle to previous model
Ctrl+LOpen model selector
Shift+TabCycle thinking level (off → low → medium → high)
Ctrl+TToggle thinking block visibility
ShortcutAction
Ctrl+OExpand/collapse tool output
Alt+EnterQueue follow-up message
Alt+UpRestore queued messages
Ctrl+VPaste image from clipboard
PageUp/PageDownScroll through output

Editor (Emacs-style defaults)

ShortcutAction
Ctrl+ABeginning of line
Ctrl+EEnd of line
Ctrl+KDelete to end of line
Ctrl+UDelete to beginning of line
Ctrl+WDelete word backward
Alt+DDelete word forward
Ctrl+YYank (paste deleted text)
Alt+YCycle through yank ring

Session Tree

ShortcutAction
Ctrl+Left/Alt+LeftFold branch or jump to previous segment
Ctrl+Right/Alt+RightUnfold branch or jump to next segment

Customizing Keybindings

Create ~/.soma/agent/keybindings.json:

{
  "tui.editor.cursorUp": ["up", "ctrl+p"],
  "tui.editor.cursorDown": ["down", "ctrl+n"],
  "app.model.select": "ctrl+m"
}

Each action accepts a single key string or an array of keys. Your config overrides defaults — unset actions keep their defaults.

After editing, run /reload in your session to apply changes without restarting.

Key Format

modifier+key — modifiers: ctrl, shift, alt (combinable).

Keys: a-z, 0-9, escape, enter, tab, space, backspace, delete, home, end, pageUp, pageDown, up, down, left, right, f1-f12, and common symbols.

Emacs Preset

{
  "tui.editor.cursorUp": ["up", "ctrl+p"],
  "tui.editor.cursorDown": ["down", "ctrl+n"],
  "tui.editor.cursorLeft": ["left", "ctrl+b"],
  "tui.editor.cursorRight": ["right", "ctrl+f"],
  "tui.editor.cursorWordLeft": ["alt+left", "alt+b"],
  "tui.editor.cursorWordRight": ["alt+right", "alt+f"],
  "tui.editor.deleteCharForward": ["delete", "ctrl+d"],
  "tui.editor.deleteCharBackward": ["backspace", "ctrl+h"],
  "tui.input.newLine": ["shift+enter", "ctrl+j"]
}

Vim Preset

{
  "tui.editor.cursorUp": ["up", "alt+k"],
  "tui.editor.cursorDown": ["down", "alt+j"],
  "tui.editor.cursorLeft": ["left", "alt+h"],
  "tui.editor.cursorRight": ["right", "alt+l"],
  "tui.editor.cursorWordLeft": ["alt+left", "alt+b"],
  "tui.editor.cursorWordRight": ["alt+right", "alt+w"]
}

All Keybinding IDs

For the complete list of every keybinding ID with its default key, see the tables below. Use these IDs in your keybindings.json.

Editor Movement

tui.editor.cursorUp, tui.editor.cursorDown, tui.editor.cursorLeft, tui.editor.cursorRight, tui.editor.cursorWordLeft, tui.editor.cursorWordRight, tui.editor.cursorLineStart, tui.editor.cursorLineEnd, tui.editor.pageUp, tui.editor.pageDown

Editor Deletion

tui.editor.deleteCharBackward, tui.editor.deleteCharForward, tui.editor.deleteWordBackward, tui.editor.deleteWordForward, tui.editor.deleteToLineStart, tui.editor.deleteToLineEnd

Editor Actions

tui.editor.yank, tui.editor.yankPop, tui.editor.undo, tui.input.newLine, tui.input.submit, tui.input.tab, tui.input.copy

Application

app.interrupt, app.clear, app.exit, app.suspend, app.editor.external, app.clipboard.pasteImage, app.tools.expand, app.message.followUp, app.message.dequeue

Models & Thinking

app.model.select, app.model.cycleForward, app.model.cycleBackward, app.thinking.cycle, app.thinking.toggle

Sessions

app.session.new, app.session.tree, app.session.fork, app.session.resume, app.session.rename, app.session.delete

Tree Navigation

app.tree.foldOrUp, app.tree.unfoldOrDown