summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authoradamelmore <[email protected]>2025-07-21 09:13:57 -0500
committeradamelmore <[email protected]>2025-07-21 10:08:25 -0500
commitc9a40917c2d5d5227b12c9e4a3f2de07463d0398 (patch)
treeb7bef40c6c0478dafb22ab05922b73c5008e50f4
parent0aa0e740cd7fe41e6bf5fc851f0c2260e9684caf (diff)
downloadopencode-c9a40917c2d5d5227b12c9e4a3f2de07463d0398.tar.gz
opencode-c9a40917c2d5d5227b12c9e4a3f2de07463d0398.zip
feat(tui): disable keybinds
-rw-r--r--packages/tui/internal/commands/command.go3
-rw-r--r--packages/web/src/content/docs/docs/keybinds.mdx23
2 files changed, 17 insertions, 9 deletions
diff --git a/packages/tui/internal/commands/command.go b/packages/tui/internal/commands/command.go
index 5a981549a..dde49e824 100644
--- a/packages/tui/internal/commands/command.go
+++ b/packages/tui/internal/commands/command.go
@@ -349,6 +349,9 @@ func LoadFromConfig(config *opencode.Config) CommandRegistry {
continue
}
if keybind, ok := keybinds[string(command.Name)]; ok && keybind != "" {
+ if keybind == "none" {
+ continue
+ }
command.Keybindings = parseBindings(keybind)
}
registry[command.Name] = command
diff --git a/packages/web/src/content/docs/docs/keybinds.mdx b/packages/web/src/content/docs/docs/keybinds.mdx
index 1d0c53b3d..1b2416f09 100644
--- a/packages/web/src/content/docs/docs/keybinds.mdx
+++ b/packages/web/src/content/docs/docs/keybinds.mdx
@@ -9,7 +9,6 @@ opencode has a list of keybinds that you can customize through the opencode conf
{
"$schema": "https://opencode.ai/config.json",
"keybinds": {
-
"leader": "ctrl+x",
"app_help": "<leader>h",
"switch_mode": "tab",
@@ -28,10 +27,6 @@ opencode has a list of keybinds that you can customize through the opencode conf
"theme_list": "<leader>t",
"project_init": "<leader>i",
- "file_list": "<leader>f",
- "file_close": "esc",
- "file_diff_toggle": "<leader>v",
-
"input_clear": "ctrl+c",
"input_paste": "ctrl+v",
"input_submit": "enter",
@@ -41,13 +36,10 @@ opencode has a list of keybinds that you can customize through the opencode conf
"messages_page_down": "pgdown",
"messages_half_page_up": "ctrl+alt+u",
"messages_half_page_down": "ctrl+alt+d",
- "messages_previous": "ctrl+up",
- "messages_next": "ctrl+down",
"messages_first": "ctrl+g",
"messages_last": "ctrl+alt+g",
- "messages_layout_toggle": "<leader>p",
"messages_copy": "<leader>y",
- "messages_revert": "<leader>r",
+
"app_exit": "ctrl+c,<leader>q"
}
}
@@ -60,3 +52,16 @@ opencode uses a `leader` key for most keybinds. This avoids conflicts in your te
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 a 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",
+ }
+}
+```