mirror of
https://github.com/pnx/dotfiles
synced 2026-06-28 04:43:40 +02:00
nvim/lua/user/plugins/editor/autocomplete.lua: update
This commit is contained in:
parent
4b299a26df
commit
0f886683f0
1 changed files with 54 additions and 6 deletions
|
|
@ -3,19 +3,54 @@ local icons = require('user.icons')
|
||||||
return {
|
return {
|
||||||
'saghen/blink.cmp',
|
'saghen/blink.cmp',
|
||||||
lazy = false,
|
lazy = false,
|
||||||
version = 'v0.*',
|
|
||||||
build = 'cargo build --release',
|
build = 'cargo build --release',
|
||||||
dependencies = {
|
dependencies = {
|
||||||
{ 'L3MON4D3/LuaSnip', version = 'v2.*' },
|
{ 'L3MON4D3/LuaSnip', version = 'v2.*' },
|
||||||
},
|
},
|
||||||
opts = {
|
opts = {
|
||||||
keymap = { preset = 'enter' },
|
keymap = {
|
||||||
|
['<Up>'] = { 'select_prev', 'fallback' },
|
||||||
|
['<Down>'] = { 'select_next', 'fallback' },
|
||||||
|
['<C-p>'] = { 'select_prev', 'fallback' },
|
||||||
|
['<C-n>'] = { 'select_next', 'fallback' },
|
||||||
|
['<S-Tab>'] = {
|
||||||
|
function(cmp)
|
||||||
|
if cmp.snippet_active() then
|
||||||
|
return cmp.accept()
|
||||||
|
else
|
||||||
|
return cmp.select_prev()
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
'snippet_backward',
|
||||||
|
'fallback'
|
||||||
|
},
|
||||||
|
|
||||||
|
['<Tab>'] = {
|
||||||
|
function(cmp)
|
||||||
|
if cmp.snippet_active() then
|
||||||
|
return cmp.accept()
|
||||||
|
else
|
||||||
|
return cmp.select_next()
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
'snippet_forward',
|
||||||
|
'fallback'
|
||||||
|
},
|
||||||
|
['<CR>'] = { 'accept', 'fallback' },
|
||||||
|
},
|
||||||
appearance = {
|
appearance = {
|
||||||
nerd_font_variant = 'mono',
|
nerd_font_variant = 'mono',
|
||||||
kind_icons = icons.symbols
|
kind_icons = icons.symbols
|
||||||
},
|
},
|
||||||
sources = {
|
sources = {
|
||||||
default = { 'lsp', 'path', 'luasnip', 'buffer' },
|
default = function(_)
|
||||||
|
local success, node = pcall(vim.treesitter.get_node)
|
||||||
|
if success and node and vim.tbl_contains({ 'comment', 'line_comment', 'block_comment' }, node:type()) then
|
||||||
|
return { 'buffer' }
|
||||||
|
else
|
||||||
|
return { 'lsp', 'path', 'luasnip', 'buffer' }
|
||||||
|
end
|
||||||
|
end
|
||||||
},
|
},
|
||||||
snippets = {
|
snippets = {
|
||||||
expand = function(snippet) require('luasnip').lsp_expand(snippet) end,
|
expand = function(snippet) require('luasnip').lsp_expand(snippet) end,
|
||||||
|
|
@ -29,18 +64,31 @@ return {
|
||||||
},
|
},
|
||||||
completion = {
|
completion = {
|
||||||
menu = {
|
menu = {
|
||||||
winblend = 5,
|
min_width = 18,
|
||||||
|
winblend = 10,
|
||||||
|
draw = {
|
||||||
|
columns = {
|
||||||
|
{ "kind_icon" },
|
||||||
|
{ "label", "label_description", "source_name", gap = 1 },
|
||||||
|
},
|
||||||
|
}
|
||||||
},
|
},
|
||||||
documentation = {
|
documentation = {
|
||||||
auto_show = true,
|
auto_show = true,
|
||||||
window = {
|
window = {
|
||||||
winblend = 5
|
winblend = 10
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
ghost_text = {
|
ghost_text = {
|
||||||
enabled = true,
|
enabled = true,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
signature = { enabled = true }
|
signature = {
|
||||||
|
enabled = true,
|
||||||
|
window = {
|
||||||
|
scrollbar = false,
|
||||||
|
winblend = 10,
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue