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 {
|
||||
'saghen/blink.cmp',
|
||||
dependencies = {
|
||||
"giuxtaposition/blink-cmp-copilot",
|
||||
},
|
||||
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 = {},
|
||||
},
|
||||
}
|
||||
|
|
|
@ -1,14 +1,35 @@
|
|||
return {
|
||||
-- Use copilot.lua for API access (no UI)
|
||||
{
|
||||
'github/copilot.vim',
|
||||
event = 'VimEnter',
|
||||
"zbirenbaum/copilot.lua",
|
||||
cmd = "Copilot",
|
||||
event = "InsertEnter",
|
||||
config = function()
|
||||
-- Accept suggestion with Ctrl-y
|
||||
vim.keymap.set('i', '<C-y>', 'copilot#Accept("\\<CR>")', {
|
||||
expr = true,
|
||||
replace_keycodes = false
|
||||
require("copilot").setup({
|
||||
suggestion = { enabled = false }, -- Disable inline ghost text
|
||||
panel = { enabled = false }, -- Disable suggestion panel
|
||||
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,
|
||||
},
|
||||
|
||||
-- Bridge between copilot.lua and blink.cmp
|
||||
{
|
||||
"giuxtaposition/blink-cmp-copilot",
|
||||
dependencies = {
|
||||
"zbirenbaum/copilot.lua",
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue