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.
You can add alternative keybindings or remove default keybindings by creating a
keybindings.json file in your home gemini directory (typically
~/.gemini/keybindings.json).
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:
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.