diff --git a/init.vim b/init.vim index 3f8a880..7e4df94 100644 --- a/init.vim +++ b/init.vim @@ -52,23 +52,28 @@ set foldmethod=syntax set scrolloff=7 " CoC settings +function! CheckBackspace() abort + let col = col('.') - 1 + return !col || getline('.')[col - 1] =~# '\s' +endfunction + inoremap \ coc#pum#visible() ? coc#pum#next(1) : + \ coc#expandableOrJumpable() ? "\=coc#snippet#next()\" : \ CheckBackspace() ? "\" : \ coc#refresh() -inoremap coc#pum#visible() ? coc#pum#prev(1) : "\" -"inoremap pumvisible() ? "\" : "\" -"inoremap pumvisible() ? "\" : "\" -nmap :CocAction +inoremap + \ coc#pum#visible() ? coc#pum#prev(1) : "\" + \ coc#expandableOrJumpable() ? "\=coc#snippet#prev()\" : + \ CheckBackspace() ? "\" : + \ coc#refresh() let g:coc_disable_startup_warning = 1 inoremap coc#pum#visible() ? coc#pum#confirm() \: "\u\\=coc#on_enter()\" -function! CheckBackspace() abort - let col = col('.') - 1 - return !col || getline('.')[col - 1] =~# '\s' -endfunction +let g:coc_snippet_next = '' +let g:coc_snippet_prev = '' func! s:my_colors_setup() abort " this is an example