Skip to main content
OpenCode has a list of keybinds that you can customize through the OpenCode config.
opencode.json

Leader Key

OpenCode uses a leader 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

string
default:"ctrl+x"
Leader key that prefixes most other keybinds.
string
default:"ctrl+c,ctrl+d,<leader>q"
Exit the application.

Editor & UI

string
default:"<leader>e"
Open the editor.
string
default:"<leader>t"
Open the theme selection list.
string
default:"<leader>b"
Toggle the sidebar visibility.
string
default:"none"
Toggle the scrollbar visibility.
string
default:"none"
Toggle username display.
string
default:"<leader>s"
View status information.
string
default:"none"
Show tool details.

Session Management

string
default:"<leader>x"
Export the current session.
string
default:"<leader>n"
Create a new session.
string
default:"<leader>l"
Show the session list.
string
default:"<leader>g"
View session timeline.
string
default:"none"
Fork the current session.
string
default:"none"
Rename the current session.
string
default:"none"
Share the current session.
string
default:"none"
Unshare the current session.
string
default:"escape"
Interrupt the current session.
string
default:"<leader>c"
Compact the session context.
string
default:"<leader>right"
Cycle to next child session.
string
default:"<leader>left"
Cycle to previous child session.
string
default:"<leader>up"
Go to parent session.

Messages Navigation

string
default:"pageup,ctrl+alt+b"
Scroll messages one page up.
string
default:"pagedown,ctrl+alt+f"
Scroll messages one page down.
string
default:"ctrl+alt+y"
Scroll messages one line up.
string
default:"ctrl+alt+e"
Scroll messages one line down.
string
default:"ctrl+alt+u"
Scroll messages half page up.
string
default:"ctrl+alt+d"
Scroll messages half page down.
string
default:"ctrl+g,home"
Jump to first message.
string
default:"ctrl+alt+g,end"
Jump to last message.
string
default:"none"
Go to next message.
string
default:"none"
Go to previous message.
string
default:"<leader>y"
Copy message content.
string
default:"<leader>u"
Undo last message action.
string
default:"<leader>r"
Redo message action.
string
default:"none"
Jump to last user message.
string
default:"<leader>h"
Toggle concealing of message details.

Model & Agent

string
default:"<leader>m"
Open model selection list.
string
default:"f2"
Cycle through recently used models.
string
default:"shift+f2"
Cycle through recently used models in reverse.
string
default:"none"
Cycle through favorite models.
string
default:"none"
Cycle through favorite models in reverse.
string
default:"ctrl+t"
Cycle through model variants.
string
default:"ctrl+p"
Open command list.
string
default:"<leader>a"
Open agent selection list.
string
default:"tab"
Cycle to next agent.
string
default:"shift+tab"
Cycle to previous agent.

Input Control

string
default:"ctrl+c"
Clear input field.
string
default:"ctrl+v"
Paste into input field.
string
default:"return"
Submit input.
string
default:"shift+return,ctrl+return,alt+return,ctrl+j"
Insert newline in input.
string
default:"left,ctrl+b"
Move cursor left.
string
default:"right,ctrl+f"
Move cursor right.
string
default:"up"
Move cursor up.
string
default:"down"
Move cursor down.
string
default:"shift+left"
Select text to the left.
string
default:"shift+right"
Select text to the right.
string
default:"shift+up"
Select text upward.
string
default:"shift+down"
Select text downward.
string
default:"ctrl+a"
Move to start of line.
string
default:"ctrl+e"
Move to end of line.
string
default:"ctrl+shift+a"
Select to start of line.
string
default:"ctrl+shift+e"
Select to end of line.
string
default:"alt+a"
Move to visual start of line.
string
default:"alt+e"
Move to visual end of line.
string
default:"alt+shift+a"
Select to visual start of line.
string
default:"alt+shift+e"
Select to visual end of line.
string
default:"home"
Move to start of buffer.
string
default:"end"
Move to end of buffer.
string
default:"shift+home"
Select to start of buffer.
string
default:"shift+end"
Select to end of buffer.
string
default:"ctrl+shift+d"
Delete entire line.
string
default:"ctrl+k"
Delete from cursor to end of line.
string
default:"ctrl+u"
Delete from cursor to start of line.
string
default:"backspace,shift+backspace"
Delete character before cursor.
string
default:"ctrl+d,delete,shift+delete"
Delete character at cursor.
string
default:"ctrl+-,super+z"
Undo input change.
string
default:"ctrl+.,super+shift+z"
Redo input change.
string
default:"alt+f,alt+right,ctrl+right"
Move forward one word.
string
default:"alt+b,alt+left,ctrl+left"
Move backward one word.
string
default:"alt+shift+f,alt+shift+right"
Select forward one word.
string
default:"alt+shift+b,alt+shift+left"
Select backward one word.
string
default:"alt+d,alt+delete,ctrl+delete"
Delete word forward.
string
default:"ctrl+w,ctrl+backspace,alt+backspace"
Delete word backward.

History

string
default:"up"
Go to previous history item.
string
default:"down"
Go to next history item.

Terminal

string
default:"ctrl+z"
Suspend the terminal.
string
default:"none"
Toggle terminal title display.

Other

string
default:"<leader>h"
Toggle tips display.
string
default:"none"
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 via opencode.json.

Shift+Enter

Some terminals don’t send modifier keys with Enter by default. You may need to configure your terminal to send Shift+Enter as an escape sequence.

Windows Terminal

Open your settings.json at:
Add this to the root-level actions array:
Add this to the root-level keybindings array:
Save the file and restart Windows Terminal or open a new tab.