Skip to main content
OpenCode provides vim-style keyboard shortcuts and intuitive key bindings for efficient navigation and control.

Global shortcuts

These shortcuts work throughout the application:
ShortcutAction
Ctrl+CQuit application (shows confirmation dialog)
Ctrl+?Toggle help dialog showing all available shortcuts
?Toggle help dialog (when not in editing mode)
Ctrl+LView application logs
Ctrl+SSwitch to a different session
Ctrl+KOpen command palette
Ctrl+OOpen model selection dialog
Ctrl+TOpen theme switcher
Ctrl+FOpen file picker to select files for upload
EscClose current dialog or overlay
Press Ctrl+? at any time to see context-sensitive shortcuts based on your current location in the application.

Chat page shortcuts

When in the main chat interface:
ShortcutAction
Ctrl+NCreate a new session (clears current chat)
Ctrl+XCancel current AI operation or generation
iFocus editor (when not already in writing mode)
EscExit writing mode and focus messages
The i key only focuses the editor when you’re not already typing. This mimics vim’s insert mode behavior.

Editor shortcuts

When the message editor is focused:
ShortcutAction
EnterSend message (when editor is not focused)
Ctrl+SSend message (when editor is focused)
\ + EnterAdd a newline without sending the message
Ctrl+EOpen external editor (set via $EDITOR environment variable)
EscBlur editor and focus messages
Ctrl+R + 0-9Delete attachment at the specified index
Ctrl+R + RDelete all attachments
EscCancel attachment delete mode
Use Ctrl+E to compose longer messages in your preferred editor like vim or nano. OpenCode creates a temporary markdown file for editing.

Message navigation

Navigate through the conversation history:
ShortcutAction
PgUp or bScroll up one page
PgDn or fScroll down one page
Ctrl+UScroll up half a page
Ctrl+DScroll down half a page
These vim-style navigation keys (b, f, Ctrl+U, Ctrl+D) work throughout the message area for efficient scrolling.

Session dialog shortcuts

When the session switcher is open (Ctrl+S):
ShortcutAction
or kMove to previous session
or jMove to next session
EnterSelect the highlighted session
EscClose dialog without switching

Model dialog shortcuts

When the model selection dialog is open (Ctrl+O):
ShortcutAction
or kMove up in model list
or jMove down in model list
or hSwitch to previous provider
or lSwitch to next provider
EnterSelect the highlighted model
EscClose dialog without changing model
Use the horizontal navigation (h/l or arrow keys) to quickly browse models from different providers like OpenAI, Anthropic, and Google.

Permission dialog shortcuts

When the AI requests permission to perform an action:
ShortcutAction
or LeftSwitch to previous option
or RightSwitch to next option
TabSwitch to next option
Enter or SpaceConfirm the selected option
aAllow permission (one time)
sAllow permission for entire session
dDeny permission
The permission dialog displays diffs, commands, or URLs for you to review before approving. Use the viewport navigation shortcuts to scroll through large previews.

Command dialog shortcuts

When the command palette is open (Ctrl+K):
ShortcutAction
or kMove to previous command
or jMove to next command
EnterExecute the highlighted command
EscClose dialog without executing

Theme dialog shortcuts

When the theme switcher is open (Ctrl+T):
ShortcutAction
or kMove to previous theme
or jMove to next theme
EnterApply the highlighted theme
EscClose dialog without changing theme

File picker shortcuts

When the file picker is open (Ctrl+F):
ShortcutAction
or kMove to previous file/directory
or jMove to next file/directory
EnterSelect file or enter directory
EscClose file picker without selecting
Arrow keysNavigate file tree

Logs page shortcuts

When viewing logs (Ctrl+L):
ShortcutAction
EscReturn to chat page
BackspaceReturn to chat page
qReturn to chat page
PgUp / PgDnScroll through logs
Ctrl+U / Ctrl+DHalf-page scroll

Completion dialog shortcuts

When using the @ completion feature:
ShortcutAction
@Trigger file/folder completion
or kPrevious completion option
or jNext completion option
EnterSelect highlighted completion
EscClose completion dialog
Type @ in the editor to autocomplete file and folder names, making it easy to reference specific files in your messages.

Vim-style navigation summary

OpenCode embraces vim keybindings for familiarity:

Movement

  • j / k for up/down
  • h / l for left/right
  • Ctrl+U / Ctrl+D for half-page scrolls

Modes

  • i to enter insert mode (focus editor)
  • Esc to exit insert mode
  • ? for help (similar to vim’s :help)

Quick reference table

Print this table for quick reference:
ActionShortcut
Send messageEnter or Ctrl+S
New sessionCtrl+N
Switch sessionCtrl+S
Cancel operationCtrl+X
Open commandsCtrl+K
Change modelCtrl+O
View helpCtrl+? or ?
ActionShortcut
Close dialogEsc
Confirm selectionEnter
Switch options / or Tab
FilesCtrl+F
ThemesCtrl+T
LogsCtrl+L
ActionShortcut
Allow oncea
Allow for sessions
Denyd
Navigate options / / Tab
ConfirmEnter or Space
Custom keybindings are not currently supported, but shortcuts follow common terminal application conventions and vim patterns for familiarity.

Build docs developers (and LLMs) love