From cec902a5651f887739203521b075ec28897443d5 Mon Sep 17 00:00:00 2001 From: Daniel Schuette Date: Tue, 10 Jan 2023 19:04:48 +0100 Subject: [PATCH] fix coc autocompletion bug --- vim-config/configs.vim | 21 +++------------------ 1 file changed, 3 insertions(+), 18 deletions(-) diff --git a/vim-config/configs.vim b/vim-config/configs.vim index 3f320794..0205a754 100644 --- a/vim-config/configs.vim +++ b/vim-config/configs.vim @@ -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 ' to make sure tab is not mapped by " other plugin before putting this into your config. -inoremap - \ pumvisible() ? "\" : - \ check_back_space() ? "\" : - \ coc#refresh() -inoremap pumvisible() ? "\" : "\" - -function! s:check_back_space() abort - let col = col('.') - 1 - return !col || getline('.')[col - 1] =~# '\s' -endfunction - -" Use to trigger completion. -if has('nvim') - inoremap coc#refresh() -else - inoremap coc#refresh() -endif +inoremap coc#pum#visible() ? coc#pum#next(1) : "\" +inoremap coc#pum#visible() ? coc#pum#prev(1) : "\" " Use to confirm completion, `u` means break undo chain at current " position. Coc only does snippet and additional edit on confirm.