| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980 |
- ---
- title: Keybinds
- description: Customize your keybinds.
- ---
- OpenCode has a list of keybinds that you can customize through the OpenCode config.
- ```json title="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",
- "username_toggle": "none",
- "status_view": "<leader>s",
- "session_export": "<leader>x",
- "session_new": "<leader>n",
- "session_list": "<leader>l",
- "session_timeline": "<leader>g",
- "session_share": "none",
- "session_unshare": "none",
- "session_interrupt": "escape",
- "session_compact": "<leader>c",
- "session_child_cycle": "<leader>+right",
- "session_child_cycle_reverse": "<leader>+left",
- "messages_page_up": "pageup",
- "messages_page_down": "pagedown",
- "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_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",
- "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": "enter",
- "input_newline": "shift+enter,ctrl+j",
- "history_previous": "up",
- "history_next": "down"
- }
- }
- ```
- ---
- ## 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.
- ---
- ## Disable keybind
- You can disable a keybind by adding the key to your config with a value of "none".
- ```json title="opencode.json"
- {
- "$schema": "https://opencode.ai/config.json",
- "keybinds": {
- "session_compact": "none"
- }
- }
- ```
|