Integrate Copilot with Blink.cmp
- Switch from copilot.vim to zbirenbaum/copilot.lua - Add blink-cmp-copilot for completion integration - Configure Blink to show Copilot in completion menu - Fix plugin import issues Testing in progress - can be reverted if needed
This commit is contained in:
parent
cdedb7f54c
commit
277be1e79b
|
@ -1,6 +1,29 @@
|
||||||
return {
|
return {
|
||||||
'saghen/blink.cmp',
|
'saghen/blink.cmp',
|
||||||
|
dependencies = {
|
||||||
|
"giuxtaposition/blink-cmp-copilot",
|
||||||
|
},
|
||||||
opts = {
|
opts = {
|
||||||
|
sources = {
|
||||||
|
default = { "lsp", "path", "copilot", "buffer" },
|
||||||
|
providers = {
|
||||||
|
copilot = {
|
||||||
|
name = "copilot",
|
||||||
|
module = "blink-cmp-copilot",
|
||||||
|
score_offset = 100, -- High priority to show Copilot near the top
|
||||||
|
async = true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
keymap = {
|
||||||
|
preset = 'default',
|
||||||
|
accept = '<C-y>', -- Your preferred accept key
|
||||||
|
},
|
||||||
|
appearance = {
|
||||||
|
-- Show source of completion (LSP/Copilot/Buffer)
|
||||||
|
use_nvim_cmp_as_default = false,
|
||||||
|
nerd_font_variant = 'mono',
|
||||||
|
},
|
||||||
fuzzy = {},
|
fuzzy = {},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,14 +1,35 @@
|
||||||
return {
|
return {
|
||||||
|
-- Use copilot.lua for API access (no UI)
|
||||||
{
|
{
|
||||||
'github/copilot.vim',
|
"zbirenbaum/copilot.lua",
|
||||||
event = 'VimEnter',
|
cmd = "Copilot",
|
||||||
|
event = "InsertEnter",
|
||||||
config = function()
|
config = function()
|
||||||
-- Accept suggestion with Ctrl-y
|
require("copilot").setup({
|
||||||
vim.keymap.set('i', '<C-y>', 'copilot#Accept("\\<CR>")', {
|
suggestion = { enabled = false }, -- Disable inline ghost text
|
||||||
expr = true,
|
panel = { enabled = false }, -- Disable suggestion panel
|
||||||
replace_keycodes = false
|
filetypes = {
|
||||||
|
yaml = false,
|
||||||
|
markdown = false,
|
||||||
|
help = false,
|
||||||
|
gitcommit = false,
|
||||||
|
gitrebase = false,
|
||||||
|
hgcommit = false,
|
||||||
|
svn = false,
|
||||||
|
cvs = false,
|
||||||
|
["."] = false,
|
||||||
|
},
|
||||||
|
copilot_node_command = 'node', -- Node.js version must be > 18.x
|
||||||
|
server_opts_overrides = {},
|
||||||
})
|
})
|
||||||
vim.g.copilot_no_tab_map = true
|
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
-- Bridge between copilot.lua and blink.cmp
|
||||||
|
{
|
||||||
|
"giuxtaposition/blink-cmp-copilot",
|
||||||
|
dependencies = {
|
||||||
|
"zbirenbaum/copilot.lua",
|
||||||
|
},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue