1
0

Enable parameter/snippet jumping.

This commit is contained in:
2025-11-13 08:10:14 +01:00
parent 7a853c9a5e
commit c503a456be

View File

@@ -52,23 +52,28 @@ set foldmethod=syntax
set scrolloff=7 set scrolloff=7
" CoC settings " CoC settings
function! CheckBackspace() abort
let col = col('.') - 1
return !col || getline('.')[col - 1] =~# '\s'
endfunction
inoremap <silent><expr> <TAB> inoremap <silent><expr> <TAB>
\ coc#pum#visible() ? coc#pum#next(1) : \ coc#pum#visible() ? coc#pum#next(1) :
\ coc#expandableOrJumpable() ? "\<C-r>=coc#snippet#next()\<CR>" :
\ CheckBackspace() ? "\<Tab>" : \ CheckBackspace() ? "\<Tab>" :
\ coc#refresh() \ coc#refresh()
inoremap <expr><S-TAB> coc#pum#visible() ? coc#pum#prev(1) : "\<C-h>" inoremap <silent><expr> <S-TAB>
"inoremap <expr> <Tab> pumvisible() ? "\<C-n>" : "\<Tab>" \ coc#pum#visible() ? coc#pum#prev(1) : "\<C-h>"
"inoremap <expr> <S-Tab> pumvisible() ? "\<C-p>" : "\<S-Tab>" \ coc#expandableOrJumpable() ? "\<C-r>=coc#snippet#prev()\<CR>" :
nmap <C-a> :CocAction<CR> \ CheckBackspace() ? "\<S-Tab>" :
\ coc#refresh()
let g:coc_disable_startup_warning = 1 let g:coc_disable_startup_warning = 1
inoremap <silent><expr> <CR> coc#pum#visible() ? coc#pum#confirm() inoremap <silent><expr> <CR> coc#pum#visible() ? coc#pum#confirm()
\: "\<C-g>u\<CR>\<c-r>=coc#on_enter()\<CR>" \: "\<C-g>u\<CR>\<c-r>=coc#on_enter()\<CR>"
function! CheckBackspace() abort let g:coc_snippet_next = '<Tab>'
let col = col('.') - 1 let g:coc_snippet_prev = '<S-Tab>'
return !col || getline('.')[col - 1] =~# '\s'
endfunction
func! s:my_colors_setup() abort func! s:my_colors_setup() abort
" this is an example " this is an example