Skip to main content
Gemini CLI ships with a comprehensive set of keyboard shortcuts for editing input, navigating history, and controlling the UI. Use this reference to learn all available key combinations.

Basic Controls

ActionKeys
Confirm the current selection or choiceEnter
Dismiss dialogs or cancel the current focusEsc, Ctrl + [
Cancel the current request or quit the CLI when input is emptyCtrl + C
Exit the CLI when the input buffer is emptyCtrl + D

Cursor Movement

ActionKeys
Move the cursor to the start of the lineCtrl + A, Home
Move the cursor to the end of the lineCtrl + E, End
Move the cursor up one lineUp Arrow
Move the cursor down one lineDown Arrow
Move the cursor one character to the leftLeft Arrow
Move the cursor one character to the rightRight Arrow, Ctrl + F
Move the cursor one word to the leftCtrl + Left Arrow, Alt + Left Arrow, Alt + B
Move the cursor one word to the rightCtrl + Right Arrow, Alt + Right Arrow, Alt + F

Editing

ActionKeys
Delete from the cursor to the end of the lineCtrl + K
Delete from the cursor to the start of the lineCtrl + U
Clear all text in the input fieldCtrl + C
Delete the previous wordCtrl + Backspace, Alt + Backspace, Ctrl + W
Delete the next wordCtrl + Delete, Alt + Delete, Alt + D
Delete the character to the leftBackspace, Ctrl + H
Delete the character to the rightDelete, Ctrl + D
Undo the most recent text editCmd + Z, Alt + Z
Redo the most recent undone text editShift + Ctrl + Z, Shift + Cmd + Z, Shift + Alt + Z

Scrolling

ActionKeys
Scroll content upShift + Up Arrow
Scroll content downShift + Down Arrow
Scroll to the topCtrl + Home, Shift + Home
Scroll to the bottomCtrl + End, Shift + End
Scroll up by one pagePage Up
Scroll down by one pagePage Down
ActionKeys
Show the previous entry in historyCtrl + P
Show the next entry in historyCtrl + N
Start reverse search through historyCtrl + R
Submit the selected reverse-search matchEnter
Accept a suggestion while reverse searchingTab
Browse and rewind previous interactionsDouble Esc
ActionKeys
Move selection up in listsUp Arrow
Move selection down in listsDown Arrow
Move up within dialog optionsUp Arrow, K
Move down within dialog optionsDown Arrow, J
Move to the next item or question in a dialogTab
Move to the previous item or question in a dialogShift + Tab

Suggestions & Completions

ActionKeys
Accept the inline suggestionTab, Enter
Move to the previous completion optionUp Arrow, Ctrl + P
Move to the next completion optionDown Arrow, Ctrl + N
Expand an inline suggestionRight Arrow
Collapse an inline suggestionLeft Arrow

Text Input

ActionKeys
Submit the current promptEnter
Insert a newline without submittingCtrl + Enter, Cmd + Enter, Alt + Enter, Shift + Enter, Ctrl + J
Open the current prompt or the plan in an external editorCtrl + X
Paste from the clipboardCtrl + V, Cmd + V, Alt + V

App Controls

ActionKeys
Toggle detailed error informationF12
Toggle the full TODO listCtrl + T
Show IDE context detailsCtrl + G
Toggle Markdown renderingAlt + M
Toggle copy mode when in alternate buffer modeCtrl + S
Toggle YOLO (auto-approval) mode for tool callsCtrl + Y
Cycle through approval modes (default, auto_edit, plan)Shift + Tab
Expand and collapse blocks of contentCtrl + O
Expand or collapse a paste placeholder when cursor is over placeholderCtrl + O
Clear the terminal screen and redraw the UICtrl + L
Restart the applicationR
Suspend the CLI and move it to the backgroundCtrl + Z

Background Shells

ActionKeys
Toggle current background shell visibilityCtrl + B
Toggle background shell listCtrl + L
Kill the active background shellCtrl + K
Confirm selection in background shell listEnter
Dismiss background shell listEsc
Move focus from background shell to GeminiShift + Tab
Move focus from background shell list to GeminiTab
Move focus from Gemini to the active shellTab
Move focus from the shell back to GeminiShift + Tab

Additional Context-Specific Shortcuts

macOS Specific

Option + B/F/M
keyboard
On macOS only, these are interpreted as Cmd + B/F/M even if your terminal isn’t configured to send Meta with Option.

Empty Prompt Shortcuts

!
keyboard
On an empty prompt: Enter or exit shell mode
?
keyboard
On an empty prompt: Toggle the shortcuts panel above the inputPress 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.

UI Mode Toggles

Tab + Tab
keyboard
While typing in the prompt: Toggle between minimal and full UI details when no completion/search interaction is activeThe 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
keyboard
While typing in the prompt: Cycle approval modes (default, auto_edit, and plan)Plan mode is skipped when agent is busy.

Line Continuation

\ + Enter
keyboard
At the end of a line: Insert a newline without leaving single-line mode

Escape Key

Esc + Esc
keyboard
Pressed twice quickly: Clear the input prompt if it is not empty, otherwise browse and rewind previous interactions

Arrow Keys in Input

Up Arrow / Down Arrow
keyboard
When the cursor is at the top or bottom of a single-line input: Navigate backward or forward through prompt history

Number Keys in Dialogs

1-9 (multi-digit)
keyboard
Inside selection dialogs: Jump directly to the numbered radio option and confirm when the full number is entered

Paste Placeholders

Ctrl + O
keyboard
Expand or collapse paste placeholders ([Pasted Text: X lines]) inline when the cursor is over the placeholder
Double-click
keyboard
On a paste placeholder (alternate buffer mode only): Expand to view full content inline. Double-click again to collapse.

Vim Mode

When vim mode is enabled (toggle with /vim), the input area supports vim-style navigation and editing commands in both NORMAL and INSERT modes.

Vim Mode Features

  • Count support: Prefix commands with numbers (e.g., 3h, 5w, 10G)
  • Editing commands: Delete with x, change with c, insert with i, a, o, O; complex operations like dd, cc, dw, cw
  • INSERT mode: Standard text input with escape to return to NORMAL mode
  • NORMAL mode: Navigate with h, j, k, l; jump by words with w, b, e; go to line start/end with 0, $, ^; go to specific lines with G (or gg for first line)
  • Repeat last command: Use . to repeat the last editing operation
  • Status indicator: When enabled, shows [NORMAL] or [INSERT] in the footer

Enable Vim Mode

/vim
The vim mode preference is saved to ~/.gemini/settings.json and restored between sessions.

Limitations

Windows Terminal:
  • Shift + Enter is not supported
  • Shift + Tab is not supported on Node 20 and earlier versions of Node 22
macOS Terminal:
  • Shift + Enter is not supported
  • /clear - Clear the terminal screen (also Ctrl + L)
  • /rewind - Browse and rewind previous interactions (also Double Esc)
  • /copy - Copy the last output to clipboard
  • /vim - Toggle vim mode

Build docs developers (and LLMs) love