add nvim-cmp

This commit is contained in:
Ray Elliott 2021-09-05 17:52:28 +01:00
parent 16266dada9
commit f7cee27291
1 changed files with 39 additions and 0 deletions

View File

@ -50,6 +50,16 @@ let g:material_style = 'lighter'
" setings after plug#end
"}}}
" #nvim-cmp {{{
" https://github.com/hrsh7th/nvim-cmp/
" completion
Plug 'hrsh7th/nvim-cmp'
Plug 'hrsh7th/cmp-nvim-lsp'
Plug 'hrsh7th/cmp-buffer'
Plug 'hrsh7th/cmp-path'
" Plug 'hrsh7th/cmp-nvim-ultisnips'
"}}}
" keeping
" #vim-hexokinase {{{
@ -480,6 +490,35 @@ end
EOF
"}}}
" #cmp-nvim-ultisnips {{{
lua <<EOF
local cmp = require'cmp'
cmp.setup({
completion = {
keyword_length = 4
-- autocomplete = false
},
-- snippet = {
-- expand = function(args)
-- vim.fn["vsnip#anonymous"](args.body)
-- end,
-- },
mapping = {
['<C-n>'] = cmp.mapping.complete(),
['<C-y>'] = cmp.mapping.confirm({ select = true }),
['<C-e>'] = cmp.mapping.abort(),
},
sources = {
{ name = 'buffer' },
{ name = 'nvim_lsp' },
{ name = 'path' },
--{ name = 'ultisnips' },
...
}
})
EOF
"}}}