Try coc.vim for completion

This commit is contained in:
Alexander Gehrke 2019-12-13 10:47:11 +01:00
parent bb247f7bdd
commit 6e8e05ae44
3 changed files with 9 additions and 5 deletions

View file

@ -4,15 +4,17 @@ if !exists('g:deoplete#omni#input_patterns')
endif endif
" <C-h>, <BS>: close popup and delete backword char. " <C-h>, <BS>: close popup and delete backword char.
inoremap <expr><C-h> deoplete#smart_close_popup()."\<C-h>" "inoremap <expr><C-h> deoplete#smart_close_popup()."\<C-h>"
inoremap <expr><BS> deoplete#smart_close_popup()."\<C-h>" "inoremap <expr><BS> deoplete#smart_close_popup()."\<C-h>"
inoremap <silent><expr> <TAB> inoremap <silent><expr> <TAB>
\ pumvisible() ? "\<C-n>" : \ pumvisible() ? "\<C-n>" :
\ <SID>check_back_space() ? "\<TAB>" : \ <SID>check_back_space() ? "\<TAB>" :
\ "\<C-x><C-o>" \ coc#refresh()
"\ '\<C-x><C-o>'
function! s:check_back_space() function! s:check_back_space()
let col = col('.') - 1 let col = col('.') - 1
return !col || getline('.')[col - 1] =~ '\s' return !col || getline('.')[col - 1] =~ '\s'
endfunction endfunction
inoremap <silent><expr> <c-space> coc#refresh()

View file

@ -44,7 +44,7 @@ set showcmd
set ignorecase smartcase set ignorecase smartcase
set inccommand=split set inccommand=split
set completeopt=menu,longest,preview set completeopt=menu,noinsert,preview
set wildmode=list:longest,list:full set wildmode=list:longest,list:full
set wildignore+=*.so,*.swp,*.zip,*.o set wildignore+=*.so,*.swp,*.zip,*.o
set suffixes=.bak,~,.h,.info,.swp,.obj,.info,.aux,.dvi,.bbl,.out,.o,.lo,\.class set suffixes=.bak,~,.h,.info,.swp,.obj,.info,.aux,.dvi,.bbl,.out,.o,.lo,\.class

View file

@ -30,7 +30,9 @@ Plug 'Chiel92/vim-autoformat'
" completion and snippets " completion and snippets
Plug 'SirVer/ultisnips' | Plug 'honza/vim-snippets' Plug 'SirVer/ultisnips' | Plug 'honza/vim-snippets'
Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' } "Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' }
Plug 'neoclide/coc.nvim', {'branch': 'release'}
Plug '/usr/share/vim/vimfiles' Plug '/usr/share/vim/vimfiles'