add copilot to the mix using blink

This commit is contained in:
Adi De Masi 2025-12-23 23:41:31 +01:00
parent 3c20990a3c
commit 2a9a8ad515
2 changed files with 27 additions and 20 deletions

View File

@ -293,6 +293,9 @@ require('lazy').setup({
}, },
}, },
}, },
{
'giuxtaposition/blink-cmp-copilot',
},
-- NOTE: Plugins can also be configured to run Lua code when they are loaded. -- NOTE: Plugins can also be configured to run Lua code when they are loaded.
-- --
@ -771,6 +774,9 @@ require('lazy').setup({
return 'make install_jsregexp' return 'make install_jsregexp'
end)(), end)(),
dependencies = { dependencies = {
-- Add the copilot source for blink here as well to ensure it loads
'giuxtaposition/blink-cmp-copilot',
'zbirenbaum/copilot.lua', -- Ensure the base copilot plugin is also present
-- `friendly-snippets` contains a variety of premade snippets. -- `friendly-snippets` contains a variety of premade snippets.
-- See the README about individual language/framework/plugin snippets: -- See the README about individual language/framework/plugin snippets:
-- https://github.com/rafamadriz/friendly-snippets -- https://github.com/rafamadriz/friendly-snippets
@ -829,8 +835,14 @@ require('lazy').setup({
}, },
sources = { sources = {
default = { 'lsp', 'path', 'snippets', 'lazydev' }, default = { 'copilot', 'lsp', 'path', 'snippets', 'lazydev' },
providers = { providers = {
copilot = {
name = 'copilot',
module = 'blink-cmp-copilot',
score_offset = 100,
async = true,
},
lazydev = { module = 'lazydev.integrations.blink', score_offset = 100 }, lazydev = { module = 'lazydev.integrations.blink', score_offset = 100 },
}, },
}, },

View File

@ -2,24 +2,19 @@ return {
'zbirenbaum/copilot.lua', 'zbirenbaum/copilot.lua',
cmd = 'Copilot', cmd = 'Copilot',
event = 'InsertEnter', event = 'InsertEnter',
-- Load before nvim-cmp to ensure copilot is ready dependencies = {
priority = 100, 'copilotlsp-nvim/copilot-lsp',
config = function() },
require('copilot').setup { opts = {
suggestion = { nes = {
enabled = true, enabled = true,
auto_trigger = true, -- Need to trigger to get suggestions for copilot-cmp
debounce = 75,
keymap = { keymap = {
accept = false, -- Disable accept keymap, use copilot-cmp instead accept_and_goto = '<leader>p',
accept_word = false, accept = false,
accept_line = false, dismiss = '<Esc>',
next = '<M-]>',
prev = '<M-[>',
dismiss = '<C-]>',
}, },
}, },
panel = { enabled = true }, suggestion = { enabled = false },
} panel = { enabled = false },
end, },
} }