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
This is an experimental feature that allows you to chat with the AI using the current buffer context. In visual mode, it captures the selected text as context, while in normal mode, it uses the current line. The AI will respond with quick edits to the files that are applied by the plugin.
16
-
17
-
Don't hesitate to give it a try and provide feedback!
18
-
19
-
Refer to the [Quick Chat](#-quick-chat) section for more details.
@@ -34,10 +18,26 @@ Refer to the [Quick Chat](#-quick-chat) section for more details.
34
18
35
19
This plugin provides a bridge between neovim and the [opencode](https://github.com/sst/opencode) AI agent, creating a chat interface while capturing editor context (current file, selections) to enhance your prompts. It maintains persistent sessions tied to your workspace, allowing for continuous conversations with the AI assistant similar to what tools like Cursor AI offer.
This is an experimental feature that allows you to chat with the AI using the current buffer context. In visual mode, it captures the selected text as context, while in normal mode, it uses the current line. The AI will respond with quick edits to the files that are applied by the plugin.
32
+
33
+
Don't hesitate to give it a try and provide feedback!
34
+
35
+
Refer to the [Quick Chat](#-quick-chat) section for more details.
36
+
37
+
<divalign="center">
38
+
<imgsrc="https://i.imgur.com/5JNlFZn.png">
39
+
</div>
40
+
41
41
## 📑 Table of Contents
42
42
43
43
-[⚠️Caution](#caution)
@@ -109,7 +109,6 @@ Install the plugin with your favorite package manager. See the [Configuration](#
109
109
require('opencode').setup({
110
110
preferred_picker=nil, -- 'telescope', 'fzf', 'mini.pick', 'snacks', 'select', if nil, it will use the best available picker. Note mini.pick does not support multiple selections
111
111
preferred_completion=nil, -- 'blink', 'nvim-cmp','vim_complete' if nil, it will use the best available completion
112
-
preferred_model=nil, -- 'provider/model' (e.g., 'github-copilot/claude-sonnet-4') to highlight and sort to top of provider list
113
112
default_global_keymaps=true, -- If false, disables all default global keymaps
114
113
default_mode='build', -- 'build' or 'plan' or any custom configured. @see [OpenCode Agents](https://opencode.ai/docs/modes/)
115
114
keymap_prefix='<leader>o', -- Default keymap prefix for global keymaps change to your preferred prefix and it will be applied to all keymaps starting with <leader>o
@@ -191,6 +190,9 @@ require('opencode').setup({
191
190
delete_entry= { '<C-d>', mode= { 'i', 'n' } }, -- Delete selected entry in the history picker
192
191
clear_all= { '<C-X>', mode= { 'i', 'n' } }, -- Clear all entries in the history picker
193
192
}
193
+
model_picker= {
194
+
toggle_favorite= { '<C-f>', mode= { 'i', 'n' } },
195
+
},
194
196
},
195
197
ui= {
196
198
position='right', -- 'right' (default), 'left' or 'current'. Position of the UI split. 'current' uses the current window for the output.
@@ -348,6 +350,28 @@ require('opencode').setup({
348
350
})
349
351
```
350
352
353
+
### Model Sorting and Favorites
354
+
355
+
The provider/model picker supports intelligent sorting based on your favorites and usage history:
356
+
357
+
#### Sorting Priority
358
+
359
+
When you open the model picker (`<leader>op`), models are sorted in the following order:
360
+
361
+
1.**Favorite models** - shown with a ⭐ icon and sorted by the order they were favorited
362
+
2.**Recently accessed models** - sorted by most recent usage
363
+
3.**Other models** - sorted alphabetically
364
+
365
+
#### Managing Favorites
366
+
367
+
In the model picker, press **`<C-f>`** to toggle the currently selected model as a favorite. Favorite models will:
368
+
369
+
- Display with a ⭐ star icon prefix
370
+
- Always appear at the top of the list
371
+
- Persist across Neovim sessions
372
+
373
+
No configuration is needed - the plugin respects and updates the OpenCode CLI format automatically.
374
+
351
375
### UI icons (disable emojis or customize)
352
376
353
377
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.
@@ -444,6 +468,7 @@ You can configure a custom action in Snacks pickers to send selected files direc
444
468
```
445
469
446
470
This allows you to:
471
+
447
472
1. Open any Snacks file picker (`:Snacks picker files`, `:Snacks picker git_files`, etc.)
448
473
2. Select one or more files using multi-select
449
474
3. Press `<localleader>o` to send those files to opencode as context
0 commit comments