feat(nvim): additional trigger and sources

This commit is contained in:
u2515h 2024-01-25 20:59:30 +01:00
parent 813da27625
commit e4e2999a24
2 changed files with 7 additions and 3 deletions

View File

@ -47,13 +47,14 @@ cmp.setup({
}, },
-- Installed sources: -- Installed sources:
sources = { sources = {
{name = 'nvim_lsp', keyword_length = 1}, -- from language server {name = 'nvim_lsp', keyword_length = 1, trigger_characters={'.', ":"} }, -- from language server
{name = 'nvim_lsp_signature_help'}, -- display function signatures with current parameter emphasized {name = 'nvim_lsp_signature_help'}, -- display function signatures with current parameter emphasized
{name = 'nvim_lsp_document_symbol' },
{name = 'nvim_lua', keyword_length = 2}, -- complete neovim's Lua runtime API such vim.lsp.* {name = 'nvim_lua', keyword_length = 2}, -- complete neovim's Lua runtime API such vim.lsp.*
{ {
name = 'omni', name = 'omni',
option = {disable_omnifuncs = {'v:lua.vim.lsp.omnifunc'}} option = {disable_omnifuncs = {'v:lua.vim.lsp.omnifunc'}}
}, {name = 'async_path', keyword_length = 3}, -- file paths }, {name = 'async_path', keyword_length = 3, trigger_characters={'/'}}, -- file paths
{name = 'buffer', keyword_length = 3}, -- source current buffer {name = 'buffer', keyword_length = 3}, -- source current buffer
{name = 'calc'}, -- source for math calculation {name = 'calc'}, -- source for math calculation
{ {
@ -63,7 +64,8 @@ cmp.setup({
keep_all_entries = false, keep_all_entries = false,
enable_in_context = function() return true end enable_in_context = function() return true end
} }
}, {name = 'conventionalcommits', keyword_length = 1}, {name = 'crates'} },
{name = 'conventionalcommits', keyword_length = 1}, {name = 'crates'},
}, },
window = { window = {
completion = cmp.config.window.bordered(), completion = cmp.config.window.bordered(),

View File

@ -64,6 +64,8 @@ in {
cmp-omni cmp-omni
cmp-nvim-lsp cmp-nvim-lsp
cmp-nvim-lua cmp-nvim-lua
cmp-nvim-lsp-signature-help
cmp-nvim-lsp-document-symbol
cmp-buffer cmp-buffer
cmp-async-path cmp-async-path
cmp-spell cmp-spell