Skip to main content
OpenCode has a list of keybinds that you can customize through the OpenCode config.
opencode.json
{
  "$schema": "https://opencode.ai/config.json",
  "keybinds": {
    "leader": "ctrl+x",
    "app_exit": "ctrl+c,ctrl+d,<leader>q",
    "editor_open": "<leader>e",
    "theme_list": "<leader>t",
    "sidebar_toggle": "<leader>b",
    "scrollbar_toggle": "none",
    "username_toggle": "none",
    "status_view": "<leader>s",
    "tool_details": "none",
    "session_export": "<leader>x",
    "session_new": "<leader>n",
    "session_list": "<leader>l",
    "session_timeline": "<leader>g",
    "session_fork": "none",
    "session_rename": "none",
    "session_share": "none",
    "session_unshare": "none",
    "session_interrupt": "escape",
    "session_compact": "<leader>c",
    "session_child_cycle": "<leader>right",
    "session_child_cycle_reverse": "<leader>left",
    "session_parent": "<leader>up",
    "messages_page_up": "pageup,ctrl+alt+b",
    "messages_page_down": "pagedown,ctrl+alt+f",
    "messages_line_up": "ctrl+alt+y",
    "messages_line_down": "ctrl+alt+e",
    "messages_half_page_up": "ctrl+alt+u",
    "messages_half_page_down": "ctrl+alt+d",
    "messages_first": "ctrl+g,home",
    "messages_last": "ctrl+alt+g,end",
    "messages_next": "none",
    "messages_previous": "none",
    "messages_copy": "<leader>y",
    "messages_undo": "<leader>u",
    "messages_redo": "<leader>r",
    "messages_last_user": "none",
    "messages_toggle_conceal": "<leader>h",
    "model_list": "<leader>m",
    "model_cycle_recent": "f2",
    "model_cycle_recent_reverse": "shift+f2",
    "model_cycle_favorite": "none",
    "model_cycle_favorite_reverse": "none",
    "variant_cycle": "ctrl+t",
    "command_list": "ctrl+p",
    "agent_list": "<leader>a",
    "agent_cycle": "tab",
    "agent_cycle_reverse": "shift+tab",
    "input_clear": "ctrl+c",
    "input_paste": "ctrl+v",
    "input_submit": "return",
    "input_newline": "shift+return,ctrl+return,alt+return,ctrl+j",
    "input_move_left": "left,ctrl+b",
    "input_move_right": "right,ctrl+f",
    "input_move_up": "up",
    "input_move_down": "down",
    "input_select_left": "shift+left",
    "input_select_right": "shift+right",
    "input_select_up": "shift+up",
    "input_select_down": "shift+down",
    "input_line_home": "ctrl+a",
    "input_line_end": "ctrl+e",
    "input_select_line_home": "ctrl+shift+a",
    "input_select_line_end": "ctrl+shift+e",
    "input_visual_line_home": "alt+a",
    "input_visual_line_end": "alt+e",
    "input_select_visual_line_home": "alt+shift+a",
    "input_select_visual_line_end": "alt+shift+e",
    "input_buffer_home": "home",
    "input_buffer_end": "end",
    "input_select_buffer_home": "shift+home",
    "input_select_buffer_end": "shift+end",
    "input_delete_line": "ctrl+shift+d",
    "input_delete_to_line_end": "ctrl+k",
    "input_delete_to_line_start": "ctrl+u",
    "input_backspace": "backspace,shift+backspace",
    "input_delete": "ctrl+d,delete,shift+delete",
    "input_undo": "ctrl+-,super+z",
    "input_redo": "ctrl+.,super+shift+z",
    "input_word_forward": "alt+f,alt+right,ctrl+right",
    "input_word_backward": "alt+b,alt+left,ctrl+left",
    "input_select_word_forward": "alt+shift+f,alt+shift+right",
    "input_select_word_backward": "alt+shift+b,alt+shift+left",
    "input_delete_word_forward": "alt+d,alt+delete,ctrl+delete",
    "input_delete_word_backward": "ctrl+w,ctrl+backspace,alt+backspace",
    "history_previous": "up",
    "history_next": "down",
    "terminal_suspend": "ctrl+z",
    "terminal_title_toggle": "none",
    "tips_toggle": "<leader>h",
    "display_thinking": "none"
  }
}

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

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

Editor & UI

keybinds.editor_open
string
default:"<leader>e"
Open the editor.
keybinds.theme_list
string
default:"<leader>t"
Open the theme selection list.
keybinds.sidebar_toggle
string
default:"<leader>b"
Toggle the sidebar visibility.
keybinds.scrollbar_toggle
string
default:"none"
Toggle the scrollbar visibility.
keybinds.username_toggle
string
default:"none"
Toggle username display.
keybinds.status_view
string
default:"<leader>s"
View status information.
keybinds.tool_details
string
default:"none"
Show tool details.

Session Management

keybinds.session_export
string
default:"<leader>x"
Export the current session.
keybinds.session_new
string
default:"<leader>n"
Create a new session.
keybinds.session_list
string
default:"<leader>l"
Show the session list.
keybinds.session_timeline
string
default:"<leader>g"
View session timeline.
keybinds.session_fork
string
default:"none"
Fork the current session.
keybinds.session_rename
string
default:"none"
Rename the current session.
keybinds.session_share
string
default:"none"
Share the current session.
keybinds.session_unshare
string
default:"none"
Unshare the current session.
keybinds.session_interrupt
string
default:"escape"
Interrupt the current session.
keybinds.session_compact
string
default:"<leader>c"
Compact the session context.
keybinds.session_child_cycle
string
default:"<leader>right"
Cycle to next child session.
keybinds.session_child_cycle_reverse
string
default:"<leader>left"
Cycle to previous child session.
keybinds.session_parent
string
default:"<leader>up"
Go to parent session.

Messages Navigation

keybinds.messages_page_up
string
default:"pageup,ctrl+alt+b"
Scroll messages one page up.
keybinds.messages_page_down
string
default:"pagedown,ctrl+alt+f"
Scroll messages one page down.
keybinds.messages_line_up
string
default:"ctrl+alt+y"
Scroll messages one line up.
keybinds.messages_line_down
string
default:"ctrl+alt+e"
Scroll messages one line down.
keybinds.messages_half_page_up
string
default:"ctrl+alt+u"
Scroll messages half page up.
keybinds.messages_half_page_down
string
default:"ctrl+alt+d"
Scroll messages half page down.
keybinds.messages_first
string
default:"ctrl+g,home"
Jump to first message.
keybinds.messages_last
string
default:"ctrl+alt+g,end"
Jump to last message.
keybinds.messages_next
string
default:"none"
Go to next message.
keybinds.messages_previous
string
default:"none"
Go to previous message.
keybinds.messages_copy
string
default:"<leader>y"
Copy message content.
keybinds.messages_undo
string
default:"<leader>u"
Undo last message action.
keybinds.messages_redo
string
default:"<leader>r"
Redo message action.
keybinds.messages_last_user
string
default:"none"
Jump to last user message.
keybinds.messages_toggle_conceal
string
default:"<leader>h"
Toggle concealing of message details.

Model & Agent

keybinds.model_list
string
default:"<leader>m"
Open model selection list.
keybinds.model_cycle_recent
string
default:"f2"
Cycle through recently used models.
keybinds.model_cycle_recent_reverse
string
default:"shift+f2"
Cycle through recently used models in reverse.
keybinds.model_cycle_favorite
string
default:"none"
Cycle through favorite models.
keybinds.model_cycle_favorite_reverse
string
default:"none"
Cycle through favorite models in reverse.
keybinds.variant_cycle
string
default:"ctrl+t"
Cycle through model variants.
keybinds.command_list
string
default:"ctrl+p"
Open command list.
keybinds.agent_list
string
default:"<leader>a"
Open agent selection list.
keybinds.agent_cycle
string
default:"tab"
Cycle to next agent.
keybinds.agent_cycle_reverse
string
default:"shift+tab"
Cycle to previous agent.

Input Control

keybinds.input_clear
string
default:"ctrl+c"
Clear input field.
keybinds.input_paste
string
default:"ctrl+v"
Paste into input field.
keybinds.input_submit
string
default:"return"
Submit input.
keybinds.input_newline
string
default:"shift+return,ctrl+return,alt+return,ctrl+j"
Insert newline in input.
keybinds.input_move_left
string
default:"left,ctrl+b"
Move cursor left.
keybinds.input_move_right
string
default:"right,ctrl+f"
Move cursor right.
keybinds.input_move_up
string
default:"up"
Move cursor up.
keybinds.input_move_down
string
default:"down"
Move cursor down.
keybinds.input_select_left
string
default:"shift+left"
Select text to the left.
keybinds.input_select_right
string
default:"shift+right"
Select text to the right.
keybinds.input_select_up
string
default:"shift+up"
Select text upward.
keybinds.input_select_down
string
default:"shift+down"
Select text downward.
keybinds.input_line_home
string
default:"ctrl+a"
Move to start of line.
keybinds.input_line_end
string
default:"ctrl+e"
Move to end of line.
keybinds.input_select_line_home
string
default:"ctrl+shift+a"
Select to start of line.
keybinds.input_select_line_end
string
default:"ctrl+shift+e"
Select to end of line.
keybinds.input_visual_line_home
string
default:"alt+a"
Move to visual start of line.
keybinds.input_visual_line_end
string
default:"alt+e"
Move to visual end of line.
keybinds.input_select_visual_line_home
string
default:"alt+shift+a"
Select to visual start of line.
keybinds.input_select_visual_line_end
string
default:"alt+shift+e"
Select to visual end of line.
keybinds.input_buffer_home
string
default:"home"
Move to start of buffer.
keybinds.input_buffer_end
string
default:"end"
Move to end of buffer.
keybinds.input_select_buffer_home
string
default:"shift+home"
Select to start of buffer.
keybinds.input_select_buffer_end
string
default:"shift+end"
Select to end of buffer.
keybinds.input_delete_line
string
default:"ctrl+shift+d"
Delete entire line.
keybinds.input_delete_to_line_end
string
default:"ctrl+k"
Delete from cursor to end of line.
keybinds.input_delete_to_line_start
string
default:"ctrl+u"
Delete from cursor to start of line.
keybinds.input_backspace
string
default:"backspace,shift+backspace"
Delete character before cursor.
keybinds.input_delete
string
default:"ctrl+d,delete,shift+delete"
Delete character at cursor.
keybinds.input_undo
string
default:"ctrl+-,super+z"
Undo input change.
keybinds.input_redo
string
default:"ctrl+.,super+shift+z"
Redo input change.
keybinds.input_word_forward
string
default:"alt+f,alt+right,ctrl+right"
Move forward one word.
keybinds.input_word_backward
string
default:"alt+b,alt+left,ctrl+left"
Move backward one word.
keybinds.input_select_word_forward
string
default:"alt+shift+f,alt+shift+right"
Select forward one word.
keybinds.input_select_word_backward
string
default:"alt+shift+b,alt+shift+left"
Select backward one word.
keybinds.input_delete_word_forward
string
default:"alt+d,alt+delete,ctrl+delete"
Delete word forward.
keybinds.input_delete_word_backward
string
default:"ctrl+w,ctrl+backspace,alt+backspace"
Delete word backward.

History

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

Terminal

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

Other

keybinds.tips_toggle
string
default:"<leader>h"
Toggle tips display.
keybinds.display_thinking
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
{
  "$schema": "https://opencode.ai/config.json",
  "keybinds": {
    "session_compact": "none"
  }
}

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.
ShortcutAction
ctrl+aMove to start of current line
ctrl+eMove to end of current line
ctrl+bMove cursor back one character
ctrl+fMove cursor forward one character
alt+bMove cursor back one word
alt+fMove cursor forward one word
ctrl+dDelete character under cursor
ctrl+kKill to end of line
ctrl+uKill to start of line
ctrl+wKill previous word
alt+dKill next word
ctrl+tTranspose characters
ctrl+gCancel 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 send Shift+Enter as an escape sequence.

Windows Terminal

Open your settings.json at:
%LOCALAPPDATA%\Packages\Microsoft.WindowsTerminal_8wekyb3d8bbwe\LocalState\settings.json
Add this to the root-level actions array:
"actions": [
  {
    "command": {
      "action": "sendInput",
      "input": "\u001b[13;2u"
    },
    "id": "User.sendInput.ShiftEnterCustom"
  }
]
Add this to the root-level keybindings array:
"keybindings": [
  {
    "keys": "shift+enter",
    "id": "User.sendInput.ShiftEnterCustom"
  }
]
Save the file and restart Windows Terminal or open a new tab.