opencode.json
Leader Key
OpenCode uses aleader key for most keybinds. This avoids conflicts in your terminal.
By default, ctrl+x is the leader key and most actions require you to first press the leader key and then the shortcut. For example, to start a new session you first press ctrl+x and then press n.
You don’t need to use a leader key for your keybinds but we recommend doing so.
Available Keybinds
Application
Leader key that prefixes most other keybinds.
Exit the application.
Editor & UI
Open the editor.
Open the theme selection list.
Toggle the sidebar visibility.
Toggle the scrollbar visibility.
Toggle username display.
View status information.
Show tool details.
Session Management
Export the current session.
Create a new session.
Show the session list.
View session timeline.
Fork the current session.
Rename the current session.
Share the current session.
Unshare the current session.
Interrupt the current session.
Compact the session context.
Cycle to next child session.
Cycle to previous child session.
Go to parent session.
Messages Navigation
Scroll messages one page up.
Scroll messages one page down.
Scroll messages one line up.
Scroll messages one line down.
Scroll messages half page up.
Scroll messages half page down.
Jump to first message.
Jump to last message.
Go to next message.
Go to previous message.
Copy message content.
Undo last message action.
Redo message action.
Jump to last user message.
Toggle concealing of message details.
Model & Agent
Open model selection list.
Cycle through recently used models.
Cycle through recently used models in reverse.
Cycle through favorite models.
Cycle through favorite models in reverse.
Cycle through model variants.
Open command list.
Open agent selection list.
Cycle to next agent.
Cycle to previous agent.
Input Control
Clear input field.
Paste into input field.
Submit input.
Insert newline in input.
Move cursor left.
Move cursor right.
Move cursor up.
Move cursor down.
Select text to the left.
Select text to the right.
Select text upward.
Select text downward.
Move to start of line.
Move to end of line.
Select to start of line.
Select to end of line.
Move to visual start of line.
Move to visual end of line.
Select to visual start of line.
Select to visual end of line.
Move to start of buffer.
Move to end of buffer.
Select to start of buffer.
Select to end of buffer.
Delete entire line.
Delete from cursor to end of line.
Delete from cursor to start of line.
Delete character before cursor.
Delete character at cursor.
Undo input change.
Redo input change.
Move forward one word.
Move backward one word.
Select forward one word.
Select backward one word.
Delete word forward.
Delete word backward.
History
Go to previous history item.
Go to next history item.
Terminal
Suspend the terminal.
Toggle terminal title display.
Other
Toggle tips display.
Display model thinking process.
Disable Keybind
You can disable a keybind by adding the key to your config with a value of “none”.opencode.json
Desktop Prompt Shortcuts
The OpenCode desktop app prompt input supports common Readline/Emacs-style shortcuts for editing text. These are built-in and currently not configurable viaopencode.json.
| Shortcut | Action |
|---|---|
ctrl+a | Move to start of current line |
ctrl+e | Move to end of current line |
ctrl+b | Move cursor back one character |
ctrl+f | Move cursor forward one character |
alt+b | Move cursor back one word |
alt+f | Move cursor forward one word |
ctrl+d | Delete character under cursor |
ctrl+k | Kill to end of line |
ctrl+u | Kill to start of line |
ctrl+w | Kill previous word |
alt+d | Kill next word |
ctrl+t | Transpose characters |
ctrl+g | Cancel popovers / abort running response |
Shift+Enter
Some terminals don’t send modifier keys with Enter by default. You may need to configure your terminal to sendShift+Enter as an escape sequence.
Windows Terminal
Open yoursettings.json at:
actions array:
keybindings array: