From e4e2999a24e96d0e35b688ddcc626ef730b878af Mon Sep 17 00:00:00 2001 From: u2515h Date: Thu, 25 Jan 2024 20:59:30 +0100 Subject: [PATCH] feat(nvim): additional trigger and sources --- completion.lua | 8 +++++--- default.nix | 2 ++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/completion.lua b/completion.lua index b8f8f68..1b0600f 100644 --- a/completion.lua +++ b/completion.lua @@ -47,13 +47,14 @@ cmp.setup({ }, -- Installed 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_document_symbol' }, {name = 'nvim_lua', keyword_length = 2}, -- complete neovim's Lua runtime API such vim.lsp.* { name = 'omni', 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 = 'calc'}, -- source for math calculation { @@ -63,7 +64,8 @@ cmp.setup({ keep_all_entries = false, enable_in_context = function() return true end } - }, {name = 'conventionalcommits', keyword_length = 1}, {name = 'crates'} + }, + {name = 'conventionalcommits', keyword_length = 1}, {name = 'crates'}, }, window = { completion = cmp.config.window.bordered(), diff --git a/default.nix b/default.nix index c942331..e65f27c 100644 --- a/default.nix +++ b/default.nix @@ -64,6 +64,8 @@ in { cmp-omni cmp-nvim-lsp cmp-nvim-lua + cmp-nvim-lsp-signature-help + cmp-nvim-lsp-document-symbol cmp-buffer cmp-async-path cmp-spell