diff options
author | listout <listout@protonmail.com> | 2022-12-11 12:25:04 +0530 |
---|---|---|
committer | listout <listout@protonmail.com> | 2022-12-11 12:25:04 +0530 |
commit | c473a4be7ef90c4444891a406ce429b30f0696cf (patch) | |
tree | 4a0ff7abd2c4d73e5622d20eb23b6463e933d1b4 /lua | |
parent | fc783d7869c22b58525227a52116ddbabaec514e (diff) |
nvim: cmp: Using example config from nvim-cmp docs
Signed-off-by: listout <listout@protonmail.com>
Diffstat (limited to 'lua')
-rw-r--r-- | lua/plugins/cmp.lua | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/lua/plugins/cmp.lua b/lua/plugins/cmp.lua index 2f901c1..25bce4b 100644 --- a/lua/plugins/cmp.lua +++ b/lua/plugins/cmp.lua @@ -112,15 +112,20 @@ cmp.setup.filetype('gitcommit', { }) -- Use buffer source for `/` (if you enabled `native_menu`, this won't work anymore). require'cmp'.setup.cmdline('/', { + completion = { autocomplete = false }, sources = { - { name = 'buffer' } -- cmp-buffer needed + -- { name = 'buffer' } + { name = 'buffer', opts = { keyword_pattern = [=[[^[:blank:]].*]=] } } } }) -- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore). -require'cmp'.setup.cmdline(':', { - sources = { - { name = 'path' }, -- cmp-path needed - } +cmp.setup.cmdline(':', { + completion = { autocomplete = false }, + sources = cmp.config.sources({ + { name = 'path' } + }, { + { name = 'cmdline' } + }) }) -- If you want insert `(` after select function or method item |