10  Keybindings

10.1 Key Format

Pi keybindings use a human-readable key format. Keys are case-insensitive for modifiers but case-sensitive for letters.

10.1.1 Modifier Keys

  • ctrl — Control key
  • alt — Alt/Option key
  • shift — Shift key
  • cmd — Command key (macOS only)

10.1.2 Combining Modifiers

Combine modifiers with +:

ctrl+c
ctrl+shift+a
alt+enter
ctrl+shift+p

10.1.3 Special Keys

Key Name Description
enter Return/Enter key
escape Escape key
tab Tab key
backspace Backspace key
delete Delete key
up, down, left, right Arrow keys
home, end Home/End keys
pageup, pagedown Page Up/Down keys
space Space bar
escape Escape key
insert Insert key
f1-f12 Function keys

10.2 Custom Keybindings

Configure keybindings in ~/.pi/agent/keybindings.json (global) or .pi/keybindings.json (project-local). Project keybindings are merged over global keybindings.

10.2.1 Basic Format

{
  "ctrl+h": "cursor.left",
  "ctrl+l": "cursor.right",
  "ctrl+k": "cursor.up",
  "ctrl+j": "cursor.down"
}

10.2.2 Emacs-Style Configuration

{
  "ctrl+a": "cursor.lineStart",
  "ctrl+e": "cursor.lineEnd",
  "ctrl+b": "cursor.left",
  "ctrl+f": "cursor.right",
  "ctrl+p": "cursor.up",
  "ctrl+n": "cursor.down",
  "ctrl+d": "cursor.deleteForward",
  "ctrl+h": "cursor.deleteBackward",
  "ctrl+k": "editor.killLine",
  "ctrl+y": "editor.yank",
  "ctrl+w": "editor.deleteWordBackward",
  "alt+b": "cursor.wordLeft",
  "alt+f": "cursor.wordRight",
  "alt+d": "editor.deleteWordForward",
  "ctrl+underscore": "editor.undo",
  "ctrl+shift+z": "editor.redo"
}

10.2.3 Vim-Style Configuration

{
  "ctrl+h": "cursor.left",
  "ctrl+j": "cursor.down",
  "ctrl+k": "cursor.up",
  "ctrl+l": "cursor.right",
  "ctrl+w": "editor.deleteWordBackward",
  "ctrl+u": "editor.killLine",
  "ctrl+[": "escape"
}
Note

Pi does not include a full Vim mode. The Vim-style configuration above maps navigation keys but does not provide modal editing. For full modal editing, use an external editor via Ctrl+G.

10.3 All Actions by Category

10.3.1 Editor Cursor

Action Description
cursor.left Move cursor one character left
cursor.right Move cursor one character right
cursor.up Move cursor up one line
cursor.down Move cursor down one line
cursor.wordLeft Move cursor one word left
cursor.wordRight Move cursor one word right
cursor.lineStart Move cursor to line start
cursor.lineEnd Move cursor to line end
cursor.docStart Move cursor to document start
cursor.docEnd Move cursor to document end
cursor.paragraphUp Move cursor up one paragraph
cursor.paragraphDown Move cursor down one paragraph

10.3.2 Editor Deletion

Action Description
editor.deleteBackward Delete character before cursor
editor.deleteForward Delete character after cursor
editor.deleteWordBackward Delete word before cursor
editor.deleteWordForward Delete word after cursor
editor.killLine Delete from cursor to end of line
editor.killLineStart Delete from line start to cursor
editor.deleteAll Clear entire editor buffer

10.3.3 Editor Input

Action Description
editor.newline Insert a newline
editor.submit Submit the current message
editor.steeringSubmit Submit as steering message (Enter)
editor.followUpSubmit Submit as follow-up message (Alt+Enter)
editor.tab Insert a tab or trigger completion

10.3.4 Editor Kill Ring

Action Description
editor.killLine Kill to end of line, adding to kill ring
editor.yank Paste the most recent kill ring entry

10.3.5 Editor Clipboard

Action Description
editor.copy Copy selection to clipboard
editor.paste Paste from clipboard
editor.cut Cut selection to clipboard
editor.selectAll Select all text
editor.undo Undo last edit
editor.redo Redo last undone edit

10.3.6 Alt Screen

Action Description
altScreen.toggle Toggle alternate screen mode

10.3.7 Application

Action Description
app.quit Quit Pi
app.abort Abort current operation
app.restoreEditor Restore queued messages to editor
app.retrieveLastMessage Retrieve last queued message to editor

10.3.8 Sessions

Action Description
session.resume Resume a previous session
session.new Start a new session
session.export Export session to HTML/JSONL
session.compact Compact context
session.show Show session info
session.tree Open session tree navigator

10.3.9 Models

Action Description
model.select Open model selector
model.cycleForward Cycle to next scoped model
model.cycleBackward Cycle to previous scoped model
model.cycleThinking Cycle thinking level

10.3.10 Display

Action Description
display.scrollUp Scroll messages up
display.scrollDown Scroll messages down
display.scrollTop Scroll to top
display.scrollBottom Scroll to bottom
display.pageUp Page up in messages
display.pageDown Page down in messages
display.toggleWrap Toggle word wrap
display.copyLastMessage Copy last assistant message

10.3.11 Tree Navigation

Action Description
tree.up Navigate up in tree
tree.down Navigate down in tree
tree.left Collapse tree node
tree.right Expand tree node
tree.select Select/activate tree node
tree.fork Fork from selected node
tree.clone Clone current branch

10.3.12 File References

Action Description
editor.fileReference Open file fuzzy-search (@)
editor.pathComplete Trigger path completion (Tab)

10.3.13 External Editor

Action Description
editor.external Open external editor (Ctrl+G)

10.4 Default Keybindings

10.4.1 Default Keymap

Key Action
Enter editor.steeringSubmit
Shift+Enter editor.newline
Ctrl+Enter (Windows Terminal) editor.newline
Alt+Enter editor.followUpSubmit
Escape app.abort
Tab editor.tab
Backspace editor.deleteBackward
Delete editor.deleteForward
Up/Down cursor.up / cursor.down
Left/Right cursor.left / cursor.right
Home/End cursor.lineStart / cursor.lineEnd
Ctrl+C app.quit (when editor is empty)
Ctrl+L model.select
Ctrl+X display.copyLastMessage
Ctrl+V editor.paste
Alt+V (Windows) editor.paste
Ctrl+G editor.external
Ctrl+P model.cycleForward
Shift+Ctrl+P model.cycleBackward
Shift+Tab model.cycleThinking
Alt+Up app.retrieveLastMessage
Page Up/Down display.pageUp / display.pageDown
Tip

Use /hotkeys in interactive mode to see all current keybindings, including any custom bindings you have configured.

10.5 Platform-Specific Notes

10.5.1 macOS

  • Alt maps to Option (⌥)
  • Cmd (⌘) is supported as a modifier
  • Terminal.app may need “Use Option as Meta key” enabled for Alt bindings

10.5.2 Windows

  • Windows Terminal uses Alt+Enter for fullscreen by default
  • Remap fullscreen or configure Pi to use a different key for follow-up messages
  • Alt+V is used for paste instead of Ctrl+V in some terminals

10.5.3 Linux

  • Most terminals support standard keybindings out of the box
  • Some terminals may not send Shift+Enter correctly
  • Check terminal documentation for modifier key support
Warning

If a keybinding does not work, your terminal may not be sending the correct escape sequence. Check your terminal’s documentation for modifier key support and configuration.