enabled snippets autocomplete via tab as well as VSCode like navigation via tab
This commit is contained in:
@@ -117,8 +117,16 @@ function! s:check_back_space() abort
|
|||||||
return !col || getline('.')[col - 1] =~ '\s'
|
return !col || getline('.')[col - 1] =~ '\s'
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
" Tab for autocomplete
|
" Make <tab> used for trigger completion, completion confirm, snippet expand and jump like VSCode.
|
||||||
inoremap <silent><expr> <Tab>
|
inoremap <silent><expr> <TAB>
|
||||||
\ pumvisible() ? "\<C-n>" :
|
\ pumvisible() ? coc#_select_confirm() :
|
||||||
\ <SID>check_back_space() ? "\<Tab>" :
|
\ coc#expandableOrJumpable() ? "\<C-r>=coc#rpc#request('doKeymap', ['snippets-expand-jump',''])\<CR>" :
|
||||||
|
\ <SID>check_back_space() ? "\<TAB>" :
|
||||||
\ coc#refresh()
|
\ 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>'
|
||||||
|
|||||||
Reference in New Issue
Block a user