feat: switch from lazy to vim.pack
This commit is contained in:
+81
-89
@@ -1,96 +1,88 @@
|
||||
---@type LazyPluginSpec
|
||||
return {
|
||||
"saghen/blink.cmp",
|
||||
-- use a release tag to download pre-built binaries
|
||||
version = "1.*",
|
||||
---@module 'blink.cmp'
|
||||
---@type blink.cmp.Config
|
||||
opts = {
|
||||
completion = {
|
||||
documentation = {
|
||||
auto_show = true,
|
||||
window = {
|
||||
winhighlight = "",
|
||||
},
|
||||
},
|
||||
ghost_text = {
|
||||
enabled = true,
|
||||
},
|
||||
list = {
|
||||
selection = {
|
||||
preselect = false,
|
||||
auto_insert = false,
|
||||
},
|
||||
},
|
||||
menu = {
|
||||
border = "none",
|
||||
draw = {
|
||||
align_to = "simple_label",
|
||||
columns = {
|
||||
{ "simple_label" },
|
||||
{ "kind_icon", "label_description", gap = 1 },
|
||||
},
|
||||
components = {
|
||||
simple_label = {
|
||||
width = { fill = true, max = 60 },
|
||||
text = function(ctx)
|
||||
return ctx.label
|
||||
end,
|
||||
highlight = function(ctx)
|
||||
local highlights = {
|
||||
{
|
||||
0,
|
||||
#ctx.label,
|
||||
group = ctx.deprecated
|
||||
and "BlinkCmpLabelDeprecated"
|
||||
or "BlinkCmpLabel",
|
||||
},
|
||||
}
|
||||
for _, idx in ipairs(ctx.label_matched_indices) do
|
||||
table.insert(highlights, {
|
||||
idx,
|
||||
idx + 1,
|
||||
group = "BlinkCmpLabelMatch",
|
||||
})
|
||||
end
|
||||
|
||||
return highlights
|
||||
end,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
fuzzy = {
|
||||
implementation = "prefer_rust_with_warning",
|
||||
},
|
||||
signature = {
|
||||
enabled = true,
|
||||
require("blink.cmp").setup({
|
||||
completion = {
|
||||
documentation = {
|
||||
auto_show = true,
|
||||
window = {
|
||||
winhighlight = "",
|
||||
show_documentation = false,
|
||||
},
|
||||
},
|
||||
sources = {
|
||||
default = {
|
||||
"lsp",
|
||||
"path",
|
||||
},
|
||||
transform_items = function(_, items)
|
||||
return vim.tbl_filter(function(item)
|
||||
return item.kind
|
||||
~= require("blink.cmp.types").CompletionItemKind.Snippet
|
||||
end, items)
|
||||
end,
|
||||
ghost_text = {
|
||||
enabled = true,
|
||||
},
|
||||
keymap = {
|
||||
preset = "none",
|
||||
["<Tab>"] = { "insert_next", "fallback" },
|
||||
["<S-Tab>"] = { "insert_prev", "fallback" },
|
||||
["<CR>"] = { "accept", "fallback" },
|
||||
["<C-k>"] = { "show_signature", "hide_signature", "fallback" },
|
||||
["<C-n>"] = { "snippet_forward", "fallback" },
|
||||
["<C-p>"] = { "snippet_backward", "fallback" },
|
||||
list = {
|
||||
selection = {
|
||||
preselect = false,
|
||||
auto_insert = false,
|
||||
},
|
||||
},
|
||||
menu = {
|
||||
border = "none",
|
||||
draw = {
|
||||
align_to = "simple_label",
|
||||
columns = {
|
||||
{ "simple_label" },
|
||||
{ "kind_icon", "label_description", gap = 1 },
|
||||
},
|
||||
components = {
|
||||
simple_label = {
|
||||
width = { fill = true, max = 60 },
|
||||
text = function(ctx)
|
||||
return ctx.label
|
||||
end,
|
||||
highlight = function(ctx)
|
||||
local highlights = {
|
||||
{
|
||||
0,
|
||||
#ctx.label,
|
||||
group = ctx.deprecated
|
||||
and "BlinkCmpLabelDeprecated"
|
||||
or "BlinkCmpLabel",
|
||||
},
|
||||
}
|
||||
for _, idx in ipairs(ctx.label_matched_indices) do
|
||||
table.insert(highlights, {
|
||||
idx,
|
||||
idx + 1,
|
||||
group = "BlinkCmpLabelMatch",
|
||||
})
|
||||
end
|
||||
|
||||
return highlights
|
||||
end,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
fuzzy = {
|
||||
implementation = "prefer_rust_with_warning",
|
||||
},
|
||||
signature = {
|
||||
enabled = true,
|
||||
window = {
|
||||
winhighlight = "",
|
||||
show_documentation = false,
|
||||
},
|
||||
},
|
||||
sources = {
|
||||
default = {
|
||||
"lsp",
|
||||
"path",
|
||||
},
|
||||
transform_items = function(_, items)
|
||||
return vim.tbl_filter(function(item)
|
||||
return item.kind
|
||||
~= require("blink.cmp.types").CompletionItemKind.Snippet
|
||||
end, items)
|
||||
end,
|
||||
},
|
||||
keymap = {
|
||||
preset = "none",
|
||||
["<Tab>"] = { "insert_next", "fallback" },
|
||||
["<S-Tab>"] = { "insert_prev", "fallback" },
|
||||
["<CR>"] = { "accept", "fallback" },
|
||||
["<C-k>"] = { "show_signature", "hide_signature", "fallback" },
|
||||
["<C-n>"] = { "snippet_forward", "fallback" },
|
||||
["<C-p>"] = { "snippet_backward", "fallback" },
|
||||
},
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user