feat(neovim): switch from completion-nvim to nvim-compe

This commit is contained in:
Felix Schröter 2021-03-26 03:38:56 +01:00
parent 3bfd20b1e9
commit b5df8e1f9d
No known key found for this signature in database
GPG key ID: 910ACB9F6BD26F58
2 changed files with 15 additions and 7 deletions

View file

@ -75,7 +75,7 @@ in {
nvim-lspconfig nvim-lspconfig
# nvim-dap # nvim-dap
completion-nvim nvim-compe
vim-orgmode vim-orgmode
]; ];

View file

@ -2,18 +2,26 @@
set completeopt=menuone,noinsert set completeopt=menuone,noinsert
set shortmess+=c set shortmess+=c
autocmd BufEnter * lua require'completion'.on_attach() let g:compe = {}
let g:compe.enabled = v:true
let g:compe.preselect = 'always'
let g:compe.allow_prefix_unmatch = v:true
let g:compe.source = {}
let g:compe.source.path = v:true
let g:compe.source.buffer = v:true
let g:compe.source.calc = v:true
let g:compe.source.nvim_lsp = v:true
let g:completion_matching_strategy_list = ['exact', 'substring', 'fuzzy'] inoremap <silent><expr> <C-Space> compe#complete()
let g:completion_matching_smart_case = 1 inoremap <silent><expr> <CR> compe#confirm('<CR>')
inoremap <silent><expr> <C-e> compe#close('<C-e>')
inoremap <silent><expr> <C-f> compe#scroll({ 'delta': +4 })
inoremap <silent><expr> <C-d> compe#scroll({ 'delta': -4 })
" Use <Tab> and <S-Tab> to navigate through popup menu " Use <Tab> and <S-Tab> to navigate through popup menu
inoremap <expr> <Tab> pumvisible() ? "\<C-n>" : "\<Tab>" inoremap <expr> <Tab> pumvisible() ? "\<C-n>" : "\<Tab>"
inoremap <expr> <S-Tab> pumvisible() ? "\<C-p>" : "\<S-Tab>" inoremap <expr> <S-Tab> pumvisible() ? "\<C-p>" : "\<S-Tab>"
" Use <c-space> to trigger completion.
imap <silent> <c-space> <Plug>(completion_trigger)
" maps " maps
nnoremap <silent> gd <cmd>lua vim.lsp.buf.definition()<CR> nnoremap <silent> gd <cmd>lua vim.lsp.buf.definition()<CR>
nnoremap <silent> gp <cmd>lua peek_definition()<CR> nnoremap <silent> gp <cmd>lua peek_definition()<CR>