mirror of
https://github.com/LazyVim/LazyVim.git
synced 2026-07-25 14:01:06 +00:00
fix(extras.ai): blink.cmp integration and menu drawing
This commit is contained in:
parent
4a626a8137
commit
c6ae68259f
4 changed files with 70 additions and 37 deletions
|
|
@ -55,17 +55,32 @@ return {
|
|||
end,
|
||||
},
|
||||
|
||||
{
|
||||
vim.g.ai_cmp and {
|
||||
"saghen/blink.cmp",
|
||||
optional = true,
|
||||
dependencies = { "codeium.nvim", "saghen/blink.compat" },
|
||||
opts = {
|
||||
sources = {
|
||||
compat = vim.g.ai_cmp and { "codeium" } or nil,
|
||||
compat = { "codeium" },
|
||||
},
|
||||
completion = {
|
||||
menu = {
|
||||
draw = {
|
||||
components = {
|
||||
kind = {
|
||||
text = function(ctx)
|
||||
return ctx.source_name == "codeium" and "Codeium" or ctx.kind
|
||||
end,
|
||||
highlight = function(ctx)
|
||||
return ctx.source_name == "codeium" and "BlinkCmpKindCodeium"
|
||||
or require("blink.cmp.completion.windows.render.tailwind").get_hl(ctx)
|
||||
or ("BlinkCmpKind" .. ctx.kind)
|
||||
end,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
dependencies = {
|
||||
"codeium.nvim",
|
||||
vim.g.ai_cmp and "saghen/blink.compat" or nil,
|
||||
},
|
||||
},
|
||||
} or nil,
|
||||
}
|
||||
|
|
|
|||
|
|
@ -94,31 +94,37 @@ return {
|
|||
},
|
||||
},
|
||||
|
||||
-- blink.cmp
|
||||
{
|
||||
vim.g.ai_cmp and {
|
||||
"saghen/blink.cmp",
|
||||
optional = true,
|
||||
dependencies = {
|
||||
{
|
||||
"giuxtaposition/blink-cmp-copilot",
|
||||
enabled = vim.g.ai_cmp, -- only enable if needed
|
||||
specs = {
|
||||
{
|
||||
"blink.cmp",
|
||||
optional = true,
|
||||
opts = {
|
||||
sources = {
|
||||
providers = {
|
||||
copilot = { name = "copilot", module = "blink-cmp-copilot" },
|
||||
},
|
||||
completion = {
|
||||
enabled_providers = { "copilot" },
|
||||
},
|
||||
dependencies = { "giuxtaposition/blink-cmp-copilot" },
|
||||
opts = {
|
||||
sources = {
|
||||
completion = {
|
||||
enabled_providers = { "copilot" },
|
||||
},
|
||||
providers = {
|
||||
copilot = { name = "copilot", module = "blink-cmp-copilot" },
|
||||
},
|
||||
},
|
||||
completion = {
|
||||
menu = {
|
||||
draw = {
|
||||
components = {
|
||||
kind = {
|
||||
text = function(ctx)
|
||||
return ctx.source_name == "copilot" and "Copilot" or ctx.kind
|
||||
end,
|
||||
highlight = function(ctx)
|
||||
return ctx.source_name == "copilot" and "BlinkCmpKindCopilot"
|
||||
or require("blink.cmp.completion.windows.render.tailwind").get_hl(ctx)
|
||||
or ("BlinkCmpKind" .. ctx.kind)
|
||||
end,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
} or nil,
|
||||
}
|
||||
|
|
|
|||
|
|
@ -43,22 +43,34 @@ return {
|
|||
end,
|
||||
},
|
||||
|
||||
-- blink.cmp integration
|
||||
{
|
||||
vim.g.ai_cmp and {
|
||||
"saghen/blink.cmp",
|
||||
optional = true,
|
||||
---@module 'blink.cmp'
|
||||
---@type blink.cmp.Config
|
||||
dependencies = { "supermaven-nvim", "saghen/blink.compat" },
|
||||
opts = {
|
||||
sources = {
|
||||
compat = vim.g.ai_cmp and { "supermaven" } or nil,
|
||||
compat = { "supermaven" },
|
||||
},
|
||||
completion = {
|
||||
menu = {
|
||||
draw = {
|
||||
components = {
|
||||
kind = {
|
||||
text = function(ctx)
|
||||
return ctx.source_name == "supermaven" and "Supermaven" or ctx.kind
|
||||
end,
|
||||
highlight = function(ctx)
|
||||
return ctx.source_name == "supermaven" and "BlinkCmpKindSupermaven"
|
||||
or require("blink.cmp.completion.windows.render.tailwind").get_hl(ctx)
|
||||
or ("BlinkCmpKind" .. ctx.kind)
|
||||
end,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
dependencies = {
|
||||
"supermaven-nvim",
|
||||
vim.g.ai_cmp and "saghen/blink.compat" or nil,
|
||||
},
|
||||
},
|
||||
} or nil,
|
||||
|
||||
{
|
||||
"nvim-lualine/lualine.nvim",
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ return {
|
|||
auto_show_delay_ms = 200,
|
||||
},
|
||||
ghost_text = {
|
||||
enabled = vim.g.ai_cmp,
|
||||
enabled = true,
|
||||
},
|
||||
},
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue