26 lines
891 B
VimL
26 lines
891 B
VimL
|
inoremap <silent><expr> <TAB>
|
||
|
\ pumvisible() ? coc#_select_confirm() :
|
||
|
\ coc#expandableOrJumpable() ? "\<C-r>=coc#rpc#request('doKeymap', ['snippets-expand-jump',''])\<CR>" :
|
||
|
\ <SID>check_back_space() ? "\<TAB>" :
|
||
|
\ coc#refresh()
|
||
|
|
||
|
function! s:check_back_space() abort
|
||
|
let col = col('.') - 1
|
||
|
return !col || getline('.')[col - 1] =~# '\s'
|
||
|
endfunction
|
||
|
|
||
|
let g:coc_snippet_next = '<tab>'
|
||
|
|
||
|
" <Tab> and <S-Tab> to navigate between choices
|
||
|
inoremap <expr> <Tab> pumvisible() ? "\<C-n>" : "\<Tab>"
|
||
|
inoremap <expr> <S-Tab> pumvisible() ? "\<C-p>" : "\<S-Tab>"
|
||
|
|
||
|
" <cr> to validate selected autocompletion
|
||
|
inoremap <expr> <cr> pumvisible() ? "\<C-y>" : "\<C-g>u\<CR>"
|
||
|
|
||
|
" Use <C-j> for jump to next placeholder, it's default of coc.nvim
|
||
|
let g:coc_snippet_next = '<c-j>'
|
||
|
|
||
|
" Use <C-k> for jump to previous placeholder, it's default of coc.nvim
|
||
|
let g:coc_snippet_prev = '<c-k>'
|