Skip to main content

Gemini CLI keyboard shortcuts

Gemini CLI ships with a set of default keyboard shortcuts for editing input, navigating history, and controlling the UI. Use this reference to learn the available combinations.

Basic Controls

CommandActionKeys
basic.confirmConfirm the current selection or choice.Enter
basic.cancelDismiss dialogs or cancel the current focus.Esc
Ctrl+[
basic.quitCancel the current request or quit the CLI when input is empty.Ctrl+C
basic.exitExit the CLI when the input buffer is empty.Ctrl+D

Cursor Movement

CommandActionKeys
cursor.homeMove the cursor to the start of the line.Ctrl+A
Home
cursor.endMove the cursor to the end of the line.Ctrl+E
End
cursor.upMove the cursor up one line.Up
cursor.downMove the cursor down one line.Down
cursor.leftMove the cursor one character to the left.Left
cursor.rightMove the cursor one character to the right.Right
Ctrl+F
cursor.wordLeftMove the cursor one word to the left.Ctrl+Left
Alt+Left
Alt+B
cursor.wordRightMove the cursor one word to the right.Ctrl+Right
Alt+Right
Alt+F

Editing

CommandActionKeys
edit.deleteRightAllDelete from the cursor to the end of the line.Ctrl+K
edit.deleteLeftAllDelete from the cursor to the start of the line.Ctrl+U
edit.clearClear all text in the input field.Ctrl+C
edit.deleteWordLeftDelete the previous word.Ctrl+Backspace
Alt+Backspace
Ctrl+W
edit.deleteWordRightDelete the next word.Ctrl+Delete
Alt+Delete
Alt+D
edit.deleteLeftDelete the character to the left.Backspace
Ctrl+H
edit.deleteRightDelete the character to the right.Delete
Ctrl+D
edit.undoUndo the most recent text edit.Cmd/Win+Z
Alt+Z
edit.redoRedo the most recent undone text edit.Ctrl+Shift+Z
Shift+Cmd/Win+Z
Alt+Shift+Z

Scrolling

CommandActionKeys
scroll.upScroll content up.Shift+Up
scroll.downScroll content down.Shift+Down
scroll.homeScroll to the top.Ctrl+Home
Shift+Home
scroll.endScroll to the bottom.Ctrl+End
Shift+End
scroll.pageUpScroll up by one page.Page Up
scroll.pageDownScroll down by one page.Page Down
CommandActionKeys
history.previousShow the previous entry in history.Ctrl+P
history.nextShow the next entry in history.Ctrl+N
history.search.startStart reverse search through history.Ctrl+R
history.search.submitSubmit the selected reverse-search match.Enter
history.search.acceptAccept a suggestion while reverse searching.Tab
CommandActionKeys
nav.upMove selection up in lists.Up
nav.downMove selection down in lists.Down
nav.dialog.upMove up within dialog options.Up
K
nav.dialog.downMove down within dialog options.Down
J
nav.dialog.nextMove to the next item or question in a dialog.Tab
nav.dialog.previousMove to the previous item or question in a dialog.Shift+Tab

Suggestions & Completions

CommandActionKeys
suggest.acceptAccept the inline suggestion.Tab
Enter
suggest.focusPreviousMove to the previous completion option.Up
Ctrl+P
suggest.focusNextMove to the next completion option.Down
Ctrl+N
suggest.expandExpand an inline suggestion.Right
suggest.collapseCollapse an inline suggestion.Left

Text Input

CommandActionKeys
input.submitSubmit the current prompt.Enter
input.newlineInsert a newline without submitting.Ctrl+Enter
Cmd/Win+Enter
Alt+Enter
Shift+Enter
Ctrl+J
input.openExternalEditorOpen the current prompt or the plan in an external editor.Ctrl+X
input.pastePaste from the clipboard.Ctrl+V
Cmd/Win+V
Alt+V

App Controls

CommandActionKeys
app.showErrorDetailsToggle detailed error information.F12
app.showFullTodosToggle the full TODO list.Ctrl+T
app.showIdeContextDetailShow IDE context details.Ctrl+G
app.toggleMarkdownToggle Markdown rendering.Alt+M
app.toggleCopyModeToggle copy mode when in alternate buffer mode.Ctrl+S
app.toggleYoloToggle YOLO (auto-approval) mode for tool calls.Ctrl+Y
app.cycleApprovalModeCycle through approval modes: default (prompt), auto_edit (auto-approve edits), and plan (read-only). Plan mode is skipped when the agent is busy.Shift+Tab
app.showMoreLinesExpand and collapse blocks of content when not in alternate buffer mode.Ctrl+O
app.expandPasteExpand or collapse a paste placeholder when cursor is over placeholder.Ctrl+O
app.focusShellInputMove focus from Gemini to the active shell.Tab
app.unfocusShellInputMove focus from the shell back to Gemini.Shift+Tab
app.clearScreenClear the terminal screen and redraw the UI.Ctrl+L
app.restartRestart the application.R
Shift+R
app.suspendSuspend the CLI and move it to the background.Ctrl+Z
app.showShellUnfocusWarningShow warning when trying to move focus away from shell input.Tab

Background Shell Controls

CommandActionKeys
background.escapeDismiss background shell list.Esc
background.selectConfirm selection in background shell list.Enter
background.toggleToggle current background shell visibility.Ctrl+B
background.toggleListToggle background shell list.Ctrl+L
background.killKill the active background shell.Ctrl+K
background.unfocusMove focus from background shell to Gemini.Shift+Tab
background.unfocusListMove focus from background shell list to Gemini.Tab
background.unfocusWarningShow warning when trying to move focus away from background shell.Tab

Customizing Keybindings

You can add alternative keybindings or remove default keybindings by creating a keybindings.json file in your home gemini directory (typically ~/.gemini/keybindings.json).

Configuration Format

The configuration uses a JSON array of objects, similar to VS Code's keybinding schema. Each object must specify a command from the reference tables above and a key combination.

[
{
"command": "edit.clear",
"key": "cmd+l"
},
{
// prefix "-" to unbind a key
"command": "-app.toggleYolo",
"key": "ctrl+y"
},
{
"command": "input.submit",
"key": "ctrl+y"
},
{
// multiple modifiers
"command": "cursor.right",
"key": "shift+alt+a"
},
{
// Some mac keyboards send "Å" instead of "shift+option+a"
"command": "cursor.right",
"key": "Å"
},
{
// some base keys have special multi-char names
"command": "cursor.right",
"key": "shift+pageup"
}
]
  • Unbinding To remove an existing or default keybinding, prefix a minus sign (-) to the command name.
  • No Auto-unbinding The same key can be bound to multiple commands in different contexts at the same time. Therefore, creating a binding does not automatically unbind the key from other commands.
  • Explicit Modifiers: Key matching is explicit. For example, a binding for ctrl+f will only trigger on exactly ctrl+f, not ctrl+shift+f or alt+ctrl+f.
  • Literal Characters: Terminals often translate complex key combinations (especially on macOS with the Option key) into special characters, losing modifier and keystroke information along the way. For example,shift+5 might be sent as %. In these cases, you must bind to the literal character % as bindings to shift+5 will never fire. To see precisely what is being sent, enable Debug Keystroke Logging and hit f12 to open the debug log console.
  • Key Modifiers: The supported key modifiers are:
    • ctrl
    • shift,
    • alt (synonyms: opt, option)
    • cmd (synonym: meta)
  • Base Key: The base key can be any single unicode code point or any of the following special keys:
    • Navigation: up, down, left, right, home, end, pageup, pagedown
    • Actions: enter, escape, tab, space, backspace, delete, clear, insert, printscreen
    • Toggles: capslock, numlock, scrolllock, pausebreak
    • Function Keys: f1 through f35
    • Numpad: numpad0 through numpad9, numpad_add, numpad_subtract, numpad_multiply, numpad_divide, numpad_decimal, numpad_separator

Additional context-specific shortcuts

  • Option+B/F/M (macOS only): Are interpreted as Cmd+B/F/M even if your terminal isn't configured to send Meta with Option.
  • ! on an empty prompt: Enter or exit shell mode.
  • ? on an empty prompt: Toggle the shortcuts panel above the input. Press Esc, Backspace, any printable key, or a registered app hotkey to close it. The panel also auto-hides while the agent is running/streaming or when action-required dialogs are shown. Press ? again to close the panel and insert a ? into the prompt.
  • Tab + Tab (while typing in the prompt): Toggle between minimal and full UI details when no completion/search interaction is active. The selected mode is remembered for future sessions. Full UI remains the default on first run, and single Tab keeps its existing completion/focus behavior.
  • Shift + Tab (while typing in the prompt): Cycle approval modes: default, auto-edit, and plan (skipped when agent is busy).
  • \ (at end of a line) + Enter: Insert a newline without leaving single-line mode.
  • Esc pressed twice quickly: Clear the input prompt if it is not empty, otherwise browse and rewind previous interactions.
  • Up Arrow / Down Arrow: When the cursor is at the top or bottom of a single-line input, navigate backward or forward through prompt history.
  • Number keys (1-9, multi-digit) inside selection dialogs: Jump directly to the numbered radio option and confirm when the full number is entered.
  • Ctrl + O: Expand or collapse paste placeholders ([Pasted Text: X lines]) inline when the cursor is over the placeholder.
  • Ctrl + X (while a plan is presented): Open the plan in an external editor to collaboratively edit or comment on the implementation strategy.
  • Double-click on a paste placeholder (alternate buffer mode only): Expand to view full content inline. Double-click again to collapse.

Limitations

  • On Windows Terminal:
    • shift+enter is only supported in version 1.25 and higher.
    • shift+tab is not supported on Node 20 and earlier versions of Node 22.
  • On macOS's Terminal:
    • shift+enter is not supported.