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

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

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.