mirror of
https://github.com/LazyVim/LazyVim.git
synced 2025-06-22 00:49:03 +02:00
feat: make copilot work when using blink (not as completion source)
This commit is contained in:
parent
f188c5729e
commit
04c2a831c4
3 changed files with 60 additions and 7 deletions
|
@ -23,12 +23,6 @@ return {
|
||||||
---@module 'blink.cmp'
|
---@module 'blink.cmp'
|
||||||
---@type blink.cmp.Config
|
---@type blink.cmp.Config
|
||||||
opts = {
|
opts = {
|
||||||
-- 'default' for mappings similar to built-in completion
|
|
||||||
-- 'super-tab' for mappings similar to vscode (tab to accept, arrow keys to navigate)
|
|
||||||
-- see the "default configuration" section below for full documentation on how to define
|
|
||||||
-- your own keymap. when defining your own, no keybinds will be assigned automatically.
|
|
||||||
keymap = "default",
|
|
||||||
|
|
||||||
highlight = {
|
highlight = {
|
||||||
-- sets the fallback highlight groups to nvim-cmp's highlight groups
|
-- sets the fallback highlight groups to nvim-cmp's highlight groups
|
||||||
-- useful for when your theme doesn't support blink.cmp
|
-- useful for when your theme doesn't support blink.cmp
|
||||||
|
@ -51,7 +45,7 @@ return {
|
||||||
},
|
},
|
||||||
|
|
||||||
-- experimental auto-brackets support
|
-- experimental auto-brackets support
|
||||||
-- accept = { auto_brackets = { enabled = true } }
|
accept = { auto_brackets = { enabled = true } },
|
||||||
|
|
||||||
-- experimental signature help support
|
-- experimental signature help support
|
||||||
-- trigger = { signature_help = { enabled = true } }
|
-- trigger = { signature_help = { enabled = true } }
|
||||||
|
@ -61,6 +55,24 @@ return {
|
||||||
enabled_providers = { "lsp", "path", "snippets", "buffer" },
|
enabled_providers = { "lsp", "path", "snippets", "buffer" },
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
|
keymap = {
|
||||||
|
["<C-space>"] = { "show", "show_documentation", "hide_documentation" },
|
||||||
|
["<C-e>"] = { "hide" },
|
||||||
|
["<C-y>"] = { "select_and_accept" },
|
||||||
|
["<CR>"] = { "select_and_accept", "fallback" },
|
||||||
|
|
||||||
|
["<Up>"] = { "select_prev", "fallback" },
|
||||||
|
["<Down>"] = { "select_next", "fallback" },
|
||||||
|
["<C-p>"] = { "select_prev", "fallback" },
|
||||||
|
["<C-n>"] = { "select_next", "fallback" },
|
||||||
|
|
||||||
|
["<C-b>"] = { "scroll_documentation_up", "fallback" },
|
||||||
|
["<C-f>"] = { "scroll_documentation_down", "fallback" },
|
||||||
|
|
||||||
|
["<Tab>"] = { "snippet_forward", "fallback" },
|
||||||
|
["<S-Tab>"] = { "snippet_backward", "fallback" },
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -80,4 +80,44 @@ return {
|
||||||
})
|
})
|
||||||
end,
|
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",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,6 +4,7 @@ local prios = {
|
||||||
["lazyvim.plugins.extras.dap.core"] = 1,
|
["lazyvim.plugins.extras.dap.core"] = 1,
|
||||||
["lazyvim.plugins.extras.ui.edgy"] = 2,
|
["lazyvim.plugins.extras.ui.edgy"] = 2,
|
||||||
["lazyvim.plugins.extras.lang.typescript"] = 5,
|
["lazyvim.plugins.extras.lang.typescript"] = 5,
|
||||||
|
["lazyvim.plugins.extras.coding.blink"] = 5,
|
||||||
["lazyvim.plugins.extras.formatting.prettier"] = 10,
|
["lazyvim.plugins.extras.formatting.prettier"] = 10,
|
||||||
-- default priority is 50
|
-- default priority is 50
|
||||||
["lazyvim.plugins.extras.editor.aerial"] = 100,
|
["lazyvim.plugins.extras.editor.aerial"] = 100,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue