nvim: added completion engine
This commit is contained in:
parent
1100fc0755
commit
58cad94a41
@ -161,8 +161,11 @@ if has('python3')
|
||||
|
||||
" my devices without python3 probably don't need these
|
||||
Plug 'neovim/nvim-lspconfig'
|
||||
Plug 'nvim-lua/completion-nvim'
|
||||
Plug 'nvim-lua/lsp-status.nvim'
|
||||
|
||||
Plug 'hrsh7th/nvim-cmp'
|
||||
Plug 'hrsh7th/cmp-nvim-lsp'
|
||||
|
||||
Plug 'stevearc/dressing.nvim'
|
||||
endif
|
||||
|
||||
|
@ -97,3 +97,22 @@ require('leap').opts.labels = { "a", "s", "d",
|
||||
"f", "k", "l", "h", "o", "d", "w", "e", "m", "b",
|
||||
"u", "y", "v", "r", "g", "t", "c", "x", "/", "z",
|
||||
}
|
||||
|
||||
local cmp = require'cmp'
|
||||
cmp.setup({
|
||||
window = {
|
||||
completion = cmp.config.window.bordered(),
|
||||
documentation = cmp.config.window.bordered(),
|
||||
},
|
||||
mapping = cmp.mapping.preset.insert({
|
||||
['<C-b>'] = cmp.mapping.scroll_docs(-4),
|
||||
['<C-f>'] = cmp.mapping.scroll_docs(4),
|
||||
['<C-Space>'] = cmp.mapping.complete(),
|
||||
['<C-e>'] = cmp.mapping.abort(),
|
||||
['<CR>'] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
|
||||
}),
|
||||
sources = cmp.config.sources({
|
||||
{ name = 'nvim_lsp' },
|
||||
{ name = 'buffer' },
|
||||
})
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user