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'
|
||||
endfunction
|
||||
|
||||
" Tab for autocomplete
|
||||
inoremap <silent><expr> <Tab>
|
||||
\ pumvisible() ? "\<C-n>" :
|
||||
\ <SID>check_back_space() ? "\<Tab>" :
|
||||
" Make <tab> used for trigger completion, completion confirm, snippet expand and jump like VSCode.
|
||||
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>'
|
||||
|
||||
Reference in New Issue
Block a user