Skip to content

Commit bffbbab

Browse files
committed
feat: remove codeium from autocomplete autofire, run this on demand with i/<C-g>a or n/<leader>aa
1 parent 2c720bd commit bffbbab

3 files changed

Lines changed: 29 additions & 4 deletions

File tree

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ A focused, batteries-included Neovim configuration built around the `mini.nvim`
3838

3939
- **Navigation & Search**`Snacks.picker`, `reach.nvim`, `marks.nvim`, `mini.visits`, and `oil.nvim` keep buffers, marks, and files within a keystroke.
4040
- **UI & Feedback**`catppuccin`, `mini.notify`, `nvim-ufo`, and `todo-comments` surface structure, notifications, and folding hints.
41-
- **Coding Aids**`nvim-cmp` + `cmp-nvim-lsp`, `nvim-treesitter`, `treesitter-context`, and `nvim_context_vt` drive completion and structural awareness. Cycle blink.cmp provider filters with `<M-n>` / `<M-p>`; a notification shows which sources are active because the popup itself can’t render a window title.
41+
- **Coding Aids**`nvim-cmp` + `cmp-nvim-lsp`, `nvim-treesitter`, `treesitter-context`, and `nvim_context_vt` drive completion and structural awareness. Cycle blink.cmp provider filters with `<M-n>` / `<M-p>`; a notification shows which sources are active because the popup itself can’t render a window title. When `ai_enabled` is set, Windsurf/Codeium stays idle until you ask for it via a manual keymap, keeping network calls to a minimum.
4242
- **Snippets & Docs**`mini.snippets`, `friendly-snippets`, and `neogen` accelerate boilerplate, while `markview.nvim`/`markdown-preview.nvim` preview Markdown.
4343
- **Integrations**`which-key`, `mini.sessions`, `mini.visits`, `mini.git`, `cord.nvim` (Discord presence), and `windsurf.nvim` (Codeium when `ai_enabled` is true) round out productivity.
4444

@@ -66,6 +66,7 @@ A focused, batteries-included Neovim configuration built around the `mini.nvim`
6666
### Completion
6767

6868
- `<M-n>`, `<M-p>` – cycle blink.cmp provider filters. The completion popup can’t show the active provider group as a title, so watch the notifications for the current selection.
69+
- `<leader>aa` (normal mode) / `<C-g>a` (insert mode) – when `ai_enabled` is true, open blink.cmp filtered to Windsurf/Codeium only, requesting AI suggestions on demand instead of automatically.
6970

7071
### Diagnostics, Toggles & Helpers
7172

after/plugin/keymaps.lua

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,31 @@ setkey("n", "<leader>s*", picker.grep_word, "Grep string under cursor")
2020
setkey("n", "<leader>sr", picker.resume, "Resume last search")
2121
setkey("n", "<leader>sn", picker.notifications, "Search notifications")
2222

23+
if vim.g.ai_enabled then
24+
local function trigger_ai_completion()
25+
local ok, blink = pcall(require, 'blink.cmp')
26+
if not ok then
27+
vim.notify("blink.cmp is not available, cannot request AI completion", vim.log.levels.WARN)
28+
return
29+
end
30+
31+
local function show_codeium()
32+
blink.show({ providers = { 'codeium' } })
33+
end
34+
35+
if vim.fn.mode():match('^[iR]') then
36+
show_codeium()
37+
return
38+
end
39+
40+
vim.cmd('startinsert')
41+
vim.schedule(show_codeium)
42+
end
43+
44+
setkey("n", "<leader>aa", trigger_ai_completion, "Ask AI completion (Codeium)")
45+
setkey("i", "<C-g>a", trigger_ai_completion, "Ask AI completion (Codeium)")
46+
end
47+
2348
-- Find some elements <leader>f...
2449
setkey("n", "<Leader>fk", picker.keymaps, "Find keymaps")
2550
setkey("n", "<Leader>fc", picker.commands, "Find commands")

lua/plugins/config/blink.lua

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -217,14 +217,13 @@ M.config = function()
217217
-- See the fuzzy documentation for more information
218218
fuzzy = { implementation = "prefer_rust_with_warning" }
219219
}
220+
220221
if vim.g.ai_enabled then
221-
table.insert(opts.sources.default, 'codeium')
222222
opts.sources.providers.codeium = {
223223
name = 'Codeium',
224224
module = 'codeium.blink',
225225
async = true,
226-
score_offset =
227-
score_offset['codeium'] or 0
226+
score_offset = score_offset['codeium'] or 0
228227
}
229228
end
230229

0 commit comments

Comments
 (0)