feat: make copilot work when using blink (not as completion source)

This commit is contained in:
Folke Lemaitre 2024-11-01 18:29:01 +01:00
parent f188c5729e
commit 04c2a831c4
3 changed files with 60 additions and 7 deletions

View file

@ -80,4 +80,44 @@ return {
})
end,
},
{
"saghen/blink.cmp",
optional = true,
specs = {
{
"zbirenbaum/copilot.lua",
event = "InsertEnter",
opts = {
suggestion = {
enabled = true,
auto_trigger = true,
keymap = { accept = false },
},
},
},
},
opts = {
windows = {
ghost_text = {
enabled = false,
},
},
keymap = {
["<Tab>"] = {
function(cmp)
if cmp.is_in_snippet() then
return cmp.accept()
elseif require("copilot.suggestion").is_visible() then
require("copilot.suggestion").accept()
else
return cmp.select_and_accept()
end
end,
"snippet_forward",
"fallback",
},
},
},
},
}