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
feat(opencode): add model variant support and cycle command
Add per-model variant support and UI/commands to select and cycle variants.
- Add lua/opencode/model_state.lua to persist favorites, recent and selected variants
- Add lua/opencode/variant_picker.lua and expose configure_variant / cycle_variant
- Thread variant through API/client, core send flow, config, types, utils and UI footer
- Update model picker, keymaps, highlights and state to load/save the current variant
Enable selecting, remembering, and cycling model variants for the active model.
Copy file name to clipboardExpand all lines: README.md
+18Lines changed: 18 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -127,6 +127,7 @@ require('opencode').setup({
127
127
['<leader>os'] = { 'select_session' }, -- Select and load a opencode session
128
128
['<leader>oR'] = { 'rename_session' }, -- Rename current session
129
129
['<leader>op'] = { 'configure_provider' }, -- Quick provider and model switch from predefined list
130
+
['<leader>oV'] = { 'configure_variant' }, -- Switch model variant for the current model
130
131
['<leader>oz'] = { 'toggle_zoom' }, -- Zoom in/out on the Opencode windows
131
132
['<leader>ov'] = { 'paste_image'}, -- Paste image from clipboard into current session
132
133
['<leader>od'] = { 'diff_open' }, -- Opens a diff tab of a modified file since the last opencode prompt
@@ -161,6 +162,7 @@ require('opencode').setup({
161
162
['<up>'] = { 'prev_prompt_history', mode= { 'n', 'i' } }, -- Navigate to previous prompt in history
162
163
['<down>'] = { 'next_prompt_history', mode= { 'n', 'i' } }, -- Navigate to next prompt in history
163
164
['<M-m>'] = { 'switch_mode' }, -- Switch between modes (build/plan)
165
+
['<M-r>'] = { 'cycle_variant', mode= { 'n', 'i' } }, -- Cycle through available model variants
164
166
},
165
167
output_window= {
166
168
['<esc>'] = { 'close' }, -- Close UI windows
@@ -169,6 +171,7 @@ require('opencode').setup({
169
171
['[['] = { 'prev_message' }, -- Navigate to previous message in the conversation
170
172
['<tab>'] = { 'toggle_pane', mode= { 'n', 'i' } }, -- Toggle between input and output panes
171
173
['i'] = { 'focus_input', 'n' }, -- Focus on input window and enter insert mode at the end of the input from the output window
174
+
['<M-r>'] = { 'cycle_variant', mode= { 'n' } }, -- Cycle through available model variants
172
175
['<leader>oS'] = { 'select_child_session' }, -- Select and load a child session
173
176
['<leader>oD'] = { 'debug_message' }, -- Open raw message in new buffer for debugging
174
177
['<leader>oO'] = { 'debug_output' }, -- Open raw output in new buffer for debugging
@@ -377,6 +380,18 @@ In the model picker, press **`<C-f>`** to toggle the currently selected model as
377
380
378
381
No configuration is needed - the plugin respects and updates the OpenCode CLI format automatically.
379
382
383
+
### Model Variants
384
+
385
+
Some models support multiple variants (e.g., different context window sizes or optimization modes). The plugin provides convenient ways to switch between available variants for the currently active model.
386
+
387
+
#### Switching Variants
388
+
389
+
-**Via picker**: Press `<leader>oV` to open the variant picker showing all available variants for the current model
390
+
-**Via cycling**: Press `<M-r>` (Alt+R) in the input or output window to cycle through available variants
391
+
-**Via slash command**: Type `/variant` in the input window
392
+
393
+
When you switch variants, the plugin remembers your selection per model, so the next time you use that model, it will automatically use the last selected variant.
394
+
380
395
### UI icons (disable emojis or customize)
381
396
382
397
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.
@@ -552,6 +567,8 @@ The plugin provides the following actions that can be triggered via keymaps, com
552
567
| Open timeline picker (navigate/undo/redo/fork to message) |`<leader>oT`|`:Opencode timeline`|`require('opencode.api').timeline()`|
0 commit comments