Skip to content

Commit

Permalink
fix coc autocompletion bug
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielSchuette committed Jan 10, 2023
1 parent 283c51b commit cec902a
Showing 1 changed file with 3 additions and 18 deletions.
21 changes: 3 additions & 18 deletions vim-config/configs.vim
Original file line number Diff line number Diff line change
Expand Up @@ -342,26 +342,11 @@ endif
autocmd BufNew,BufEnter *.ts execute "silent! CocDisable"
autocmd BufLeave *.ts execute "silent! CocEnable"

" Use tab for trigger completion with characters ahead and navigate.
" Use tab for trigger completion with characters ahead.
" NOTE: Use command ':verbose imap <tab>' to make sure tab is not mapped by
" other plugin before putting this into your config.
inoremap <silent><expr> <TAB>
\ pumvisible() ? "\<C-n>" :
\ <SID>check_back_space() ? "\<TAB>" :
\ coc#refresh()
inoremap <expr><S-TAB> pumvisible() ? "\<C-p>" : "\<C-h>"
function! s:check_back_space() abort
let col = col('.') - 1
return !col || getline('.')[col - 1] =~# '\s'
endfunction

" Use <c-space> to trigger completion.
if has('nvim')
inoremap <silent><expr> <c-space> coc#refresh()
else
inoremap <silent><expr> <c-@> coc#refresh()
endif
inoremap <expr> <Tab> coc#pum#visible() ? coc#pum#next(1) : "\<Tab>"
inoremap <expr> <S-Tab> coc#pum#visible() ? coc#pum#prev(1) : "\<S-Tab>"
" Use <cr> to confirm completion, `<C-g>u` means break undo chain at current
" position. Coc only does snippet and additional edit on confirm.
Expand Down

0 comments on commit cec902a

Please sign in to comment.