feat(neovim): switch from completion-nvim to nvim-compe
This commit is contained in:
parent
3bfd20b1e9
commit
b5df8e1f9d
|
@ -75,7 +75,7 @@ in {
|
|||
nvim-lspconfig
|
||||
# nvim-dap
|
||||
|
||||
completion-nvim
|
||||
nvim-compe
|
||||
|
||||
vim-orgmode
|
||||
];
|
||||
|
|
|
@ -2,18 +2,26 @@
|
|||
set completeopt=menuone,noinsert
|
||||
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']
|
||||
let g:completion_matching_smart_case = 1
|
||||
inoremap <silent><expr> <C-Space> compe#complete()
|
||||
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
|
||||
inoremap <expr> <Tab> pumvisible() ? "\<C-n>" : "\<Tab>"
|
||||
inoremap <expr> <S-Tab> pumvisible() ? "\<C-p>" : "\<S-Tab>"
|
||||
|
||||
" Use <c-space> to trigger completion.
|
||||
imap <silent> <c-space> <Plug>(completion_trigger)
|
||||
|
||||
" maps
|
||||
nnoremap <silent> gd <cmd>lua vim.lsp.buf.definition()<CR>
|
||||
nnoremap <silent> gp <cmd>lua peek_definition()<CR>
|
||||
|
|
Loading…
Reference in a new issue