8.7 KiB
8.7 KiB
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
| Action | Keys |
|---|---|
| Confirm the current selection or choice. | Enter |
| Dismiss dialogs or cancel the current focus. | Esc |
| Cancel the current request or quit the CLI when input is empty. | Ctrl + C |
| Exit the CLI when the input buffer is empty. | Ctrl + D |
Cursor Movement
| Action | Keys |
|---|---|
| Move the cursor to the start of the line. | Ctrl + AHome (no Shift, Ctrl) |
| Move the cursor to the end of the line. | Ctrl + EEnd (no Shift, Ctrl) |
| Move the cursor up one line. | Up Arrow (no Shift, Alt, Ctrl, Cmd) |
| Move the cursor down one line. | Down Arrow (no Shift, Alt, Ctrl, Cmd) |
| Move the cursor one character to the left. | Left Arrow (no Shift, Alt, Ctrl, Cmd)Ctrl + B |
| Move the cursor one character to the right. | Right Arrow (no Shift, Alt, Ctrl, Cmd)Ctrl + F |
| Move the cursor one word to the left. | Ctrl + Left ArrowAlt + Left ArrowAlt + B |
| Move the cursor one word to the right. | Ctrl + Right ArrowAlt + Right ArrowAlt + F |
Editing
| Action | Keys |
|---|---|
| Delete from the cursor to the end of the line. | Ctrl + K |
| Delete from the cursor to the start of the line. | Ctrl + U |
| Clear all text in the input field. | Ctrl + C |
| Delete the previous word. | Ctrl + BackspaceAlt + BackspaceCtrl + W |
| Delete the next word. | Ctrl + DeleteAlt + Delete |
| Delete the character to the left. | BackspaceCtrl + H |
| Delete the character to the right. | DeleteCtrl + D |
| Undo the most recent text edit. | Ctrl + Z (no Shift) |
| Redo the most recent undone text edit. | Shift + Ctrl + Z |
Scrolling
| Action | Keys |
|---|---|
| Scroll content up. | Shift + Up Arrow |
| Scroll content down. | Shift + Down Arrow |
| Scroll to the top. | Ctrl + HomeShift + Home |
| Scroll to the bottom. | Ctrl + EndShift + End |
| Scroll up by one page. | Page Up |
| Scroll down by one page. | Page Down |
History & Search
| Action | Keys |
|---|---|
| Show the previous entry in history. | Ctrl + P (no Shift) |
| Show the next entry in history. | Ctrl + N (no Shift) |
| Start reverse search through history. | Ctrl + R |
| Submit the selected reverse-search match. | Enter (no Ctrl) |
| Accept a suggestion while reverse searching. | Tab |
| Browse and rewind previous interactions. | Double Esc |
Navigation
| Action | Keys |
|---|---|
| Move selection up in lists. | Up Arrow (no Shift) |
| Move selection down in lists. | Down Arrow (no Shift) |
| Move up within dialog options. | Up Arrow (no Shift)K (no Shift) |
| Move down within dialog options. | Down Arrow (no Shift)J (no Shift) |
Suggestions & Completions
| Action | Keys |
|---|---|
| Accept the inline suggestion. | TabEnter (no Ctrl) |
| Move to the previous completion option. | Up Arrow (no Shift)Ctrl + P (no Shift) |
| Move to the next completion option. | Down Arrow (no Shift)Ctrl + N (no Shift) |
| Expand an inline suggestion. | Right Arrow |
| Collapse an inline suggestion. | Left Arrow |
Text Input
| Action | Keys |
|---|---|
| Submit the current prompt. | Enter (no Shift, Alt, Ctrl, Cmd) |
| Insert a newline without submitting. | Ctrl + EnterCmd + EnterAlt + EnterShift + EnterCtrl + J |
| Open the current prompt in an external editor. | Ctrl + X |
| Paste from the clipboard. | Ctrl + VCmd + VAlt + V |
App Controls
| Action | Keys |
|---|---|
| Toggle detailed error information. | F12 |
| Toggle the full TODO list. | Ctrl + T |
| Show IDE context details. | Ctrl + G |
| Toggle Markdown rendering. | Alt + M |
| Toggle copy mode when in alternate buffer mode. | Ctrl + S |
| Toggle YOLO (auto-approval) mode for tool calls. | Ctrl + Y |
| Cycle through approval modes: default (prompt), auto_edit (auto-approve edits), and plan (read-only). | Shift + Tab |
| Expand a height-constrained response to show additional lines when not in alternate buffer mode. | Ctrl + S |
| Focus the shell input from the gemini input. | Tab (no Shift) |
| Focus the Gemini input from the shell input. | Tab |
| Clear the terminal screen and redraw the UI. | Ctrl + L |
| Restart the application. | R |
Additional context-specific shortcuts
Option+B/F/M(macOS only): Are interpreted asCmd+B/F/Meven if your terminal isn't configured to send Meta with Option.!on an empty prompt: Enter or exit shell mode.\(at end of a line) +Enter: Insert a newline without leaving single-line mode.Escpressed 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.