Update nvim/init.vim
parent
bc3a168db1
commit
18ec0e24bf
|
|
@ -118,3 +118,18 @@ imap <C-j> <Plug>(coc-snippets-expand-jump)
|
|||
" Use <leader>x for convert visual selected code to snippet
|
||||
xmap <leader>x <Plug>(coc-convert-snippet)
|
||||
|
||||
" #####################################################
|
||||
" <Tab>: completion
|
||||
inoremap <silent><expr> <Tab>
|
||||
\ pumvisible() ? "\<C-N>" :
|
||||
\ s:check_back_space() ? "\<Tab>" :
|
||||
\ coc#refresh()
|
||||
" <S-Tab>: completion back
|
||||
inoremap <silent><expr> <S-Tab> pumvisible() ? "\<C-P>" : "\<C-H>"
|
||||
" <CR>: confirm completion, or insert <CR>
|
||||
inoremap <expr> <CR> pumvisible() ? "\<C-Y>" : "\<CR>"
|
||||
|
||||
function! s:check_back_space() abort
|
||||
let col = col('.') - 1
|
||||
return !col || getline('.')[col - 1] =~ '\s'
|
||||
endfunction
|
||||
Loading…
Reference in New Issue