Keybindings Reference

Keybindings Reference

#

pig exposes named actions, such as app.session.new, that can be assigned keybindings. You can change default assignments or bind unassigned actions in pig's user configuration.

Run /hotkeys to see the active shortcuts for the main editor and application.

Tip (Blink Shell / iPadOS interaction experience, pig-only): On macOS terminal (TUI) or Web UI, hold down the ⌘ (Command) key on its own for ~0.85s to pop up an interactive shortcuts cheat sheet (HUD) in the center of the screen. Release ⌘ to dismiss immediately, allowing you to inspect all active shortcuts on the fly!

Assign keybindings

#

Create <agent-dir>/keybindings.json. The agent directory defaults to ~/.pig/agent and is described in Agent directory.

Map each action identifier to one key or a list of keys:

{
  "app.session.new": "ctrl+shift+n",
  "app.session.tree": ["ctrl+shift+t", "alt+shift+t"]
}

A configured value replaces the default for that action. Old action names from earlier releases are migrated to their current IDs; an unknown ID is reported. Use an empty list to disable an action's keybindings:

{
  "tui.altScreen.pageUp": []
}

After editing the file, run /reload to apply the changes to the active session.

Key syntax

#

Write a key as modifier+key. Modifiers are ctrl, shift, alt, and super (or command / cmd). You can combine modifiers. Valid 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: ` `, -, =, [, ], \, ;, ', ,, ., /, !, @, #, $, %, ^, &, *, (, ), _, +, |, ~, {, }, :, <, >, ?`

Examples: ctrl+shift+x, alt+ctrl+x, ctrl+shift+alt+x, super+k, ctrl+super+k, and ctrl+1.

super bindings require a terminal that reports the modifier separately, typically through the Kitty keyboard protocol. They may not work in terminals without that support.

Actions

#

Terminal UI

#

Cursor movement

#
Keybinding idDefaultDescription
tui.editor.cursorUpupMove cursor up, browsing older history at the top
tui.editor.cursorDowndownMove cursor down, browsing newer history at the bottom
tui.editor.historyPreviousNoneSelect the previous prompt history entry
tui.editor.historyNextNoneSelect the next prompt history entry
tui.editor.cursorLeftleft, ctrl+bMove cursor left
tui.editor.cursorRightright, ctrl+fMove cursor right
tui.editor.cursorWordLeftalt+left, ctrl+left, alt+bMove cursor word left
tui.editor.cursorWordRightalt+right, ctrl+right, alt+fMove cursor word right
tui.editor.cursorLineStarthome, ctrl+aMove to line start
tui.editor.cursorLineEndend, ctrl+eMove to line end
tui.editor.jumpForwardctrl+]Jump forward to character
tui.editor.jumpBackwardctrl+alt+]Jump backward to character
tui.editor.pageUppageUp, ctrl+pageUpScroll up by page
tui.editor.pageDownpageDown, ctrl+pageDownScroll down by page

The dedicated history actions browse prompt history regardless of cursor position and take precedence over application actions using the same key.

Text editing

#
Keybinding idDefaultDescription
tui.editor.deleteCharBackwardbackspaceDelete character backward
tui.editor.deleteCharForwarddelete, ctrl+dDelete character forward
tui.editor.deleteWordBackwardctrl+w, alt+backspaceDelete word backward
tui.editor.deleteWordForwardalt+d, alt+deleteDelete word forward
tui.editor.deleteToLineStartctrl+uDelete to line start
tui.editor.deleteToLineEndctrl+kDelete to line end
tui.editor.yankctrl+yPaste most recently deleted text
tui.editor.yankPopalt+yCycle through deleted text after yank
tui.editor.undoctrl+- (ctrl+z on native Windows; alt+z under WSL)Undo last edit

Input and selection

#
Keybinding idDefaultDescription
tui.input.newLineshift+enter, ctrl+jInsert new line
tui.input.submitenterSubmit input / send message
tui.input.tabtabTab or autocomplete
tui.input.copyctrl+cCopy selection
tui.select.upupMove selection up
tui.select.downdownMove selection down
tui.select.pageUppageUpPage up in list
tui.select.pageDownpageDownPage down in list
tui.select.confirmenterConfirm selection
tui.select.cancelescape, ctrl+cCancel selection

Fullscreen

#

In fullscreen mode, these actions control the transcript and take precedence over editor actions using the same key.

Keybinding idDefaultDescription
tui.altScreen.pageUppageUpScroll the transcript up by one page
tui.altScreen.pageDownpageDownScroll the transcript down by one page
tui.altScreen.halfPageUpNoneScroll the transcript up by half a page
tui.altScreen.halfPageDownNoneScroll the transcript down by half a page
tui.altScreen.lineUpNoneScroll the transcript up by one line
tui.altScreen.lineDownNoneScroll the transcript down by one line
tui.altScreen.previousPromptctrl+shift+up, ctrl+up (ctrl+up only on Windows and WSL)Jump to the previous marked message
tui.altScreen.nextPromptctrl+shift+down, ctrl+down (ctrl+down only on Windows and WSL)Jump to the next marked message
tui.altScreen.searchctrl+shift+f (ctrl+f on Windows and WSL)Search the rendered transcript
tui.altScreen.searchNextenter, ctrl+gSelect the next search match while searching
tui.altScreen.searchPreviousshift+enter, ctrl+shift+gSelect the previous search match while searching
tui.altScreen.searchCloseescapeClose transcript search
tui.altScreen.topctrl+homeScroll to the beginning of the transcript
tui.altScreen.bottomctrl+endScroll to the transcript end and follow new output

Application

#
Keybinding idDefaultDescription
app.interruptescapeCancel / abort
app.clearctrl+cClear editor (first) / exit (second); also cancels a running loader or closes the config selector
app.exitctrl+dExit when the editor is empty; with text, deletes the character after the cursor
app.suspendctrl+z (None on Windows)Suspend to background
app.editor.externalctrl+gOpen in external editor (externalEditor, $VISUAL, $EDITOR, Notepad on Windows, or nano elsewhere)
app.clipboard.pasteImagectrl+v (alt+v on Windows and WSL)Paste files on macOS, images, or text from clipboard

On native Windows, app.suspend has no default because Windows terminals do not support Unix job control. If you assign it manually, pig shows a status message instead of suspending. WSL uses the normal ctrl+z and fg behavior.

Sessions

#
Keybinding idDefaultDescription
app.session.newNoneStart a new session (/new)
app.session.treeNoneOpen session tree navigator (/tree)
app.session.forkNoneFork current session (/fork)
app.session.resumeNoneOpen session resume picker (/resume)
app.session.togglePathctrl+pToggle path display
app.session.toggleSortctrl+sToggle sort mode
app.session.toggleNamedFilterctrl+nToggle named-only filter
app.session.renamectrl+rRename session
app.session.deletectrl+dDelete session
app.session.deleteNoninvasivectrl+backspaceDelete session when query is empty

Models and Thinking

#
Keybinding idDefaultDescription
app.model.selectctrl+lOpen model selector
app.model.cycleForwardctrl+pCycle to next model
app.model.cycleBackwardshift+ctrl+p (alt+p on Windows and WSL)Cycle to previous model
app.models.savectrl+sSave the selected default model or scoped model configuration to settings
app.thinking.cycleshift+tabCycle thinking level
app.thinking.savectrl+sSave current thinking level to settings
app.thinking.togglectrl+tCollapse or expand thinking blocks

Display and Message Queue

#
Keybinding idDefaultDescription
app.tools.expandctrl+oCollapse or expand tool output
app.message.copyctrl+xCopy the selected message in /tree; in fullscreen mode, copy the active selection when fullscreenCopyOnSelect is false; otherwise copy the last assistant message
app.message.followUpcommand+enter, alt+enter (ctrl+q on Windows and WSL)Queue follow-up message (or submit when idle). command+enter is a pig addition; upstream pi binds only alt+enter
app.message.dequeuealt+up (alt+q on Windows and WSL)Restore queued messages to editor

Tree Navigation

#
Keybinding idDefaultDescription
app.tree.foldOrUpctrl+left, alt+left (alt+left first on macOS)Fold current branch segment, or jump to the previous segment start
app.tree.unfoldOrDownctrl+right, alt+right (alt+right first on macOS)Unfold current branch segment, or jump to the next segment start or branch end
app.tree.editLabelshift+lEdit the label on the selected tree node (a plain l types into the tree search)
app.tree.toggleLabelTimestampshift+tToggle label timestamps in the tree
app.tree.filter.defaultctrl+dSet tree filter to default view
app.tree.filter.noToolsctrl+tToggle tree filter that hides tool results
app.tree.filter.userOnlyctrl+uToggle tree filter that shows only user messages
app.tree.filter.labeledOnlyctrl+lToggle tree filter that shows only labeled entries
app.tree.filter.allctrl+aToggle tree filter that shows all entries
app.tree.filter.cycleForwardctrl+oCycle tree filter forward
app.tree.filter.cycleBackwardshift+ctrl+oCycle tree filter backward

Scoped Models Selector

#

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

Keybinding idDefaultDescription
app.models.enableAllctrl+aEnable all models (or all matching the current search)
app.models.clearAllctrl+xClear all models (or all matching the current search)
app.models.toggleProviderctrl+pToggle all models for the current provider
app.models.reorderUpalt+upMove the selected model up in the cycle order
app.models.reorderDownalt+downMove the selected model down in the cycle order