diff --git a/vimrc b/vimrc index c5a2340..31d5036 100644 --- a/vimrc +++ b/vimrc @@ -120,3 +120,17 @@ function! SynStack() endif echo map(synstack(line('.'), col('.')), 'synIDattr(v:val, "name")') endfunc + +" use to trigger completion and navigate to the next complete item +function! CheckBackspace() abort + let col = col('.') - 1 + return !col || getline('.')[col - 1] =~# '\s' +endfunction + +inoremap + \ coc#pum#visible() ? coc#pum#next(1) : + \ CheckBackspace() ? "\" : + \ coc#refresh() + +inoremap coc#pum#visible() ? coc#pum#next(1) : "\" +inoremap coc#pum#visible() ? coc#pum#prev(1) : "\"