Fix snippet expand

This commit is contained in:
ducnn 2022-10-09 22:16:26 +07:00
parent ccf00845d1
commit c2ce602c88
1 changed files with 4 additions and 3 deletions

View File

@ -46,16 +46,17 @@ let g:gruvbox_contrast_light = 'hard'
"Coc.nvim
inoremap <silent><expr> <cr> pumvisible() ? coc#_select_confirm() : "\<C-g>u\<cr>"
inoremap <silent><expr> <TAB>
\ pumvisible() ? coc#_select_confirm() :
\ coc#pum#visible() ? coc#_select_confirm() :
\ coc#expandableOrJumpable() ? "\<C-r>=coc#rpc#request('doKeymap', ['snippets-expand-jump',''])\<CR>" :
\ <SID>check_back_space() ? "\<TAB>" :
\ CheckBackSpace() ? "\<TAB>" :
\ coc#refresh()
function! s:check_back_space() abort
function! CheckBackSpace() abort
let col = col('.') - 1
return !col || getline('.')[col - 1] =~# '\s'
endfunction
let g:coc_snippet_next = '<tab>'
let g:coc_snippet_next = '<tab>'
nnoremap <leader>e :CocCommand snippets.editSnippets<CR>