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.
--
@ -771,6 +774,9 @@ require('lazy').setup({
return 'make install_jsregexp'
end)(),
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.
-- See the README about individual language/framework/plugin snippets:
-- https://github.com/rafamadriz/friendly-snippets
@ -829,8 +835,14 @@ require('lazy').setup({
},
sources = {
default = { 'lsp', 'path', 'snippets', 'lazydev' },
default = { 'copilot', 'lsp', 'path', 'snippets', 'lazydev' },
providers = {
copilot = {
name = 'copilot',
module = 'blink-cmp-copilot',
score_offset = 100,
async = true,
},
lazydev = { module = 'lazydev.integrations.blink', score_offset = 100 },
},
},

View File

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