You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+72-43Lines changed: 72 additions & 43 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -90,6 +90,8 @@ Install the plugin with your favorite package manager. See the [Configuration](#
90
90
91
91
## ⚙️ Configuration
92
92
93
+
> **Note**: The keymap configuration structure has been updated. Old keymaps (`keymap.global` and `keymap.window`) will be mapped to the new format (`keymap.editor`, `keymap.input_window`, `keymap.output_window`) but you should update your config to the new format. See [Keymap Configuration](#keymap-configuration) below for details.
94
+
93
95
```lua
94
96
-- Default configuration with all available options
95
97
require('opencode').setup({
@@ -98,49 +100,58 @@ require('opencode').setup({
98
100
default_global_keymaps=true, -- If false, disables all default global keymaps
99
101
default_mode='build', -- 'build' or 'plan' or any custom configured. @see [OpenCode Agents](https://opencode.ai/docs/modes/)
100
102
keymap= {
101
-
global= {
102
-
toggle='<leader>og', -- Open opencode. Close if opened
103
-
open_input='<leader>oi', -- Opens and focuses on input window on insert mode
104
-
open_input_new_session='<leader>oI', -- Opens and focuses on input window on insert mode. Creates a new session
105
-
open_output='<leader>oo', -- Opens and focuses on output window
106
-
toggle_focus='<leader>ot', -- Toggle focus between opencode and last window
107
-
close='<leader>oq', -- Close UI windows
108
-
select_session='<leader>os', -- Select and load a opencode session
109
-
configure_provider='<leader>op', -- Quick provider and model switch from predefined list
110
-
diff_open='<leader>od', -- Opens a diff tab of a modified file since the last opencode prompt
111
-
diff_next='<leader>o]', -- Navigate to next file diff
112
-
diff_prev='<leader>o[', -- Navigate to previous file diff
113
-
diff_close='<leader>oc', -- Close diff view tab and return to normal editing
114
-
diff_revert_all_last_prompt='<leader>ora', -- Revert all file changes since the last opencode prompt
115
-
diff_revert_this_last_prompt='<leader>ort', -- Revert current file changes since the last opencode prompt
116
-
diff_revert_all='<leader>orA', -- Revert all file changes since the last opencode session
117
-
diff_revert_this='<leader>orT', -- Revert current file changes since the last opencode session
overrides= {}, -- Optional per-key overrides, see section below
168
+
overrides= {}, -- Optional per-key overrides, see section below
158
169
},
159
170
output= {
160
171
tools= {
@@ -224,6 +235,24 @@ require('opencode').setup({
224
235
})
225
236
```
226
237
238
+
### Keymap Configuration
239
+
240
+
The keymap configuration has been restructured for better organization and clarity:
241
+
242
+
-**`editor`**: Global keymaps that are available throughout Neovim
243
+
-**`input_window`**: Keymaps specific to the input window
244
+
-**`output_window`**: Keymaps specific to the output window
245
+
-**`permission`**: Special keymaps for responding to permission requests (available in input/output windows when there's a pending permission)
246
+
247
+
**Backward Compatibility**: The plugin automatically maps configurations that use `keymap.global` and `keymap.window` to the new structure. A deprecation warning will be shown during migration. Update your configuration to use the new structure to remove the warning.
248
+
249
+
Each keymap entry is a table consising of:
250
+
251
+
- The string name of an api function = `{ 'toggle' }`
- An optional desc: `{'toggle', desc = 'Toggle Opencode' }`
255
+
227
256
### UI icons (disable emojis or customize)
228
257
229
258
By default, opencode.nvim uses emojis for icons in the UI. If you prefer a plain, emoji-free interface, you can switch to the `text` preset or override icons individually.
0 commit comments