diff options
author | Juan J. Martinez <jjm@usebox.net> | 2021-12-06 14:15:59 +0000 |
---|---|---|
committer | Juan J. Martinez <jjm@usebox.net> | 2022-05-29 22:57:30 +0100 |
commit | 98fa2f083062c4f85b0b2f2057b30e76e9b8e309 (patch) | |
tree | 8bd53941c7d03f9682812e4d151f02617b464ac3 /cmp.vim | |
parent | 783154e2c1b45238f53527fc02d6ea5a670b7c7f (diff) | |
download | dotnvim-98fa2f083062c4f85b0b2f2057b30e76e9b8e309.tar.gz dotnvim-98fa2f083062c4f85b0b2f2057b30e76e9b8e309.zip |
Use CMP
Diffstat (limited to 'cmp.vim')
-rw-r--r-- | cmp.vim | 36 |
1 files changed, 36 insertions, 0 deletions
@@ -0,0 +1,36 @@ +lua <<EOF + -- Setup nvim-cmp. + local cmp = require'cmp' + + cmp.setup({ + snippet = { + expand = function(args) + vim.fn["vsnip#anonymous"](args.body) + end, + }, + mapping = { + ['<CR>'] = cmp.mapping.confirm({ select = true }), + }, + sources = cmp.config.sources({ + { name = 'nvim_lsp' }, + { name = 'vsnip' }, + }) + }) + + -- Use buffer source for `/` (if you enabled `native_menu`, this won't work anymore). + cmp.setup.cmdline('/', { + sources = { + { name = 'buffer' } + } + }) + + -- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore). + cmp.setup.cmdline(':', { + sources = cmp.config.sources({ + { name = 'path' } + }, { + { name = 'cmdline' } + }) + }) +EOF + |