fork of prime agent with changes i want but are not upstreamable probqbly (and some fixes)
11 kB
Markdown
at main

Keybindings #

All keyboard shortcuts can be customized via ~/.prime/agent/keybindings.json. Each action can be bound to one or more keys.

The config file uses the same namespaced keybinding ids that Prime Agent uses internally and that extension authors use in keyHint() and injected keybindings managers.

Older configs using pre-namespaced ids such as cursorUp or expandTools are migrated automatically to the namespaced ids on startup.

After editing keybindings.json, run /reload in Prime Agent to apply the changes without restarting the session.

Key Format #

modifier+key where modifiers are ctrl, shift, alt (combinable) and keys are:

  • Letters: a-z
  • Digits: 0-9
  • Special: escape, esc, enter, return, tab, space, backspace, delete, insert, clear, home, end, pageUp, pageDown, up, down, left, right
  • Function: f1-f12
  • Symbols: `, -, =, [, ], \, ;, ', ,, ., /, !, @, #, $, %, ^, &, *, (, ), _, +, |, ~, {, }, :, <, >, ?

Modifier combinations: ctrl+shift+x, alt+ctrl+x, ctrl+shift+alt+x, ctrl+1, etc.

All Actions #

TUI Editor Cursor Movement #

Keybinding id Default Description
tui.editor.cursorUp up Move cursor up
tui.editor.cursorDown down Move cursor down
tui.editor.cursorLeft left, ctrl+b Move cursor left
tui.editor.cursorRight right, ctrl+f Move cursor right
tui.editor.cursorWordLeft alt+left, ctrl+left, alt+b Move cursor word left
tui.editor.cursorWordRight alt+right, ctrl+right, alt+f Move cursor word right
tui.editor.cursorLineStart home, ctrl+a Move to line start
tui.editor.cursorLineEnd end, ctrl+e Move to line end
tui.editor.jumpForward ctrl+] Jump forward to character
tui.editor.jumpBackward ctrl+alt+] Jump backward to character
tui.editor.pageUp pageUp Scroll up by page
tui.editor.pageDown pageDown Scroll down by page

TUI Editor Deletion #

Keybinding id Default Description
tui.editor.deleteCharBackward backspace Delete character backward
tui.editor.deleteCharForward delete, ctrl+d Delete character forward
tui.editor.deleteWordBackward ctrl+w, alt+backspace Delete word backward
tui.editor.deleteWordForward alt+d, alt+delete Delete word forward
tui.editor.deleteToLineStart ctrl+u Delete to line start
tui.editor.deleteToLineEnd ctrl+k Delete to line end

TUI Input #

Keybinding id Default Description
tui.input.newLine shift+enter Insert new line
tui.input.submit enter Submit input
tui.input.tab tab Tab / autocomplete

TUI Kill Ring #

Keybinding id Default Description
tui.editor.yank ctrl+y Paste most recently deleted text
tui.editor.yankPop alt+y Cycle through deleted text after yank
tui.editor.undo ctrl+- Undo last edit

TUI Clipboard and Selection #

Keybinding id Default Description
tui.input.copy ctrl+c Copy selection
tui.select.up up Move selection up
tui.select.down down Move selection down
tui.select.pageUp pageUp Page up in list
tui.select.pageDown pageDown Page down in list
tui.select.confirm enter Confirm selection
tui.select.cancel escape, ctrl+c Cancel selection

TUI Fullscreen Transcript #

Keybinding id Default Description
tui.viewport.pageUp pageUp Scroll transcript up a page
tui.viewport.pageDown pageDown Scroll transcript down a page
tui.viewport.top shift+alt+up Scroll transcript to top
tui.viewport.follow ctrl+shift+down Scroll to bottom and follow output

Application #

Keybinding id Default Description
app.interrupt (none) Interrupt current operation
app.clear ctrl+c Interrupt current operation, then exit
app.input.clear escape Clear input
app.exit ctrl+d Exit (when editor empty)
app.suspend ctrl+z (none on Windows) Suspend to background
app.editor.external ctrl+g Open in external editor ($VISUAL or $EDITOR)
app.editor.pasteFile alt+k Move the most recent paste into a file, or toggle a live pasted file between plain and secret
app.editor.pasteSecret shift+alt+k Move the most recent paste into a secret file (needs a terminal that reports shifted keys, e.g. Kitty keyboard protocol)
app.clipboard.pasteImage ctrl+v (alt+v on Windows) Paste image from clipboard
app.clipboard.copyLoginUrl c, alt+c Copy the sign-in URL from a login dialog

Sessions #

Keybinding id Default Description
app.session.new (none) Start a new session (/new)
app.session.tree (none) Open session tree navigator (/tree)
app.session.fork (none) Fork current session (/fork)
app.session.resume (none) Open session resume picker (/resume)

Models and Thinking #

Keybinding id Default Description
app.model.select ctrl+l Open model selector
app.model.toggleScope alt+s Toggle between all and scoped models

Configuration Pickers #

Models, Providers, and MCP Connections open as separate pickers. Use escape to close a picker. Left and right edit a nonempty search field; with an empty model search, they adjust the highlighted model's effort.

Display and Message Queue #

Keybinding id Default Description
app.tools.expand ctrl+o Cycle overview → thinking and file diffs → all output
app.messages.expand ctrl+p Expand or collapse agent-to-agent messages, independently of tools
app.edits.expand ctrl+j Expand or collapse edit diffs, independently of tools
app.message.followUp alt+enter Queue follow-up message
app.message.navigateOlder alt+up Select the next older pending message
app.message.navigateNewer alt+down Select the next newer pending message or restore the draft
app.message.moveEarlier ctrl+alt+up Move the selected pending message one place earlier in its queue
app.message.moveLater ctrl+alt+down Move the selected pending message one place later in its queue

Ctrl+O changes presentation only: the default hides thinking and collapses tools and diffs; the first press reveals thinking and file diffs; the second expands tool output and full agent-to-agent message bodies; the third returns to the default. Compact sent and received message notices remain visible in every mode. This also works for restored conversations and new streaming content. Ctrl+J, Ctrl+T, and Ctrl+P no longer control conversation expansion.

Tree Navigation #

Keybinding id Default Description
app.tree.foldOrUp ctrl+left, alt+left Fold current branch segment, or jump to the previous segment start
app.tree.unfoldOrDown ctrl+right, alt+right Unfold current branch segment, or jump to the next segment start or branch end
app.tree.editLabel shift+l Edit the label on the selected tree node
app.tree.toggleLabelTimestamp shift+t Toggle label timestamps in the tree
app.tree.filter.default ctrl+d Set tree filter to default view
app.tree.filter.noTools ctrl+t Toggle tree filter that hides tool results
app.tree.filter.userOnly ctrl+u Toggle tree filter that shows only user messages
app.tree.filter.labeledOnly ctrl+l Toggle tree filter that shows only labeled entries
app.tree.filter.all ctrl+a Toggle tree filter that shows all entries
app.tree.filter.cycleForward ctrl+o Cycle tree filter forward
app.tree.filter.cycleBackward shift+ctrl+o Cycle tree filter backward

Scoped Models Selector #

Used inside the scoped models selector (opened via /scoped-models).

Keybinding id Default Description
app.models.save ctrl+s Save current model selection to settings
app.models.enableAll ctrl+a Enable all models (or all matching the current search)
app.models.clearAll ctrl+x Clear all models (or all matching the current search)
app.models.toggleProvider ctrl+p Toggle all models for the current provider
app.models.reorderUp alt+up Move the selected model up in the cycle order
app.models.reorderDown alt+down Move the selected model down in the cycle order

Custom Configuration #

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

{
  "tui.editor.cursorUp": ["up", "ctrl+p"],
  "tui.editor.cursorDown": ["down", "ctrl+n"],
  "tui.editor.deleteWordBackward": ["ctrl+w", "alt+backspace"]
}

Each action can have a single key or an array of keys. User config overrides defaults.

On native Windows, app.suspend has no default binding because Windows terminals do not support Unix job control. If you bind it manually, Prime Agent shows a status message instead of suspending. In WSL, the normal Linux ctrl+z/fg behavior still applies.

Emacs Example #

Binding ctrl+p below moves the editor cursor up; shortcuts in other views keep their defaults.

{
  "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 Example #

{
  "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"]
}