Fix snippet expand
This commit is contained in:
parent
ccf00845d1
commit
c2ce602c88
7
init.vim
7
init.vim
@ -46,16 +46,17 @@ let g:gruvbox_contrast_light = 'hard'
|
|||||||
"Coc.nvim
|
"Coc.nvim
|
||||||
inoremap <silent><expr> <cr> pumvisible() ? coc#_select_confirm() : "\<C-g>u\<cr>"
|
inoremap <silent><expr> <cr> pumvisible() ? coc#_select_confirm() : "\<C-g>u\<cr>"
|
||||||
inoremap <silent><expr> <TAB>
|
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>" :
|
\ coc#expandableOrJumpable() ? "\<C-r>=coc#rpc#request('doKeymap', ['snippets-expand-jump',''])\<CR>" :
|
||||||
\ <SID>check_back_space() ? "\<TAB>" :
|
\ CheckBackSpace() ? "\<TAB>" :
|
||||||
\ coc#refresh()
|
\ coc#refresh()
|
||||||
|
|
||||||
function! s:check_back_space() abort
|
function! CheckBackSpace() abort
|
||||||
let col = col('.') - 1
|
let col = col('.') - 1
|
||||||
return !col || getline('.')[col - 1] =~# '\s'
|
return !col || getline('.')[col - 1] =~# '\s'
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
let g:coc_snippet_next = '<tab>'
|
||||||
let g:coc_snippet_next = '<tab>'
|
let g:coc_snippet_next = '<tab>'
|
||||||
nnoremap <leader>e :CocCommand snippets.editSnippets<CR>
|
nnoremap <leader>e :CocCommand snippets.editSnippets<CR>
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user