2024-12-31 17:08:32 -08:00
|
|
|
return {
|
|
|
|
'blink.cmp',
|
|
|
|
event = 'InsertEnter',
|
|
|
|
before = function()
|
2025-01-01 13:59:07 -08:00
|
|
|
require('lz.n').trigger_load({
|
|
|
|
'mini.icons',
|
|
|
|
'luasnip',
|
|
|
|
})
|
2024-12-31 17:08:32 -08:00
|
|
|
end,
|
|
|
|
after = function()
|
|
|
|
---@module 'blink.cmp'
|
|
|
|
---@type blink.cmp.Config
|
|
|
|
local opts = {
|
|
|
|
appearance = {
|
|
|
|
use_nvim_cmp_as_default = false,
|
|
|
|
nerd_font_variant = 'mono',
|
|
|
|
},
|
|
|
|
completion = {
|
|
|
|
accept = {
|
|
|
|
auto_brackets = {
|
|
|
|
enabled = true,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
menu = {
|
|
|
|
draw = {
|
|
|
|
treesitter = { 'lsp' },
|
|
|
|
components = {
|
|
|
|
kind_icon = {
|
|
|
|
ellipsis = false,
|
|
|
|
text = function(ctx)
|
|
|
|
local icon, _, _ = require('mini.icons').get('lsp', ctx.kind)
|
|
|
|
return icon
|
|
|
|
end,
|
|
|
|
highlight = function(ctx)
|
|
|
|
local _, hl, _ = require('mini.icons').get('lsp', ctx.kind)
|
|
|
|
return hl
|
|
|
|
end,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
documentation = {
|
|
|
|
auto_show = true,
|
|
|
|
auto_show_delay_ms = 200,
|
|
|
|
},
|
|
|
|
ghost_text = {
|
|
|
|
enabled = false,
|
|
|
|
},
|
|
|
|
list = {
|
|
|
|
selection = 'manual',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
2025-01-01 13:59:07 -08:00
|
|
|
snippets = {
|
|
|
|
expand = function(snippet)
|
|
|
|
require('luasnip').lsp_expand(snippet)
|
|
|
|
end,
|
|
|
|
|
|
|
|
active = function(filter)
|
|
|
|
if filter and filter.direction then
|
|
|
|
return require('luasnip').jumpable(filter.direction)
|
|
|
|
end
|
|
|
|
|
|
|
|
return require('luasnip').in_snippet()
|
|
|
|
end,
|
|
|
|
|
|
|
|
jump = function(direction)
|
|
|
|
require('luasnip').jump(direction)
|
|
|
|
end,
|
|
|
|
},
|
|
|
|
|
2024-12-31 17:08:32 -08:00
|
|
|
sources = {
|
|
|
|
default = { 'lsp', 'path', 'snippets', 'buffer', 'luasnip' },
|
|
|
|
},
|
|
|
|
|
|
|
|
keymap = {
|
|
|
|
preset = 'super-tab',
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
|
|
|
require('blink.cmp').setup(opts)
|
|
|
|
end,
|
|
|
|
}
|