Advertisement
SkyLeach

coc.nvim.autocomplete.map

Apr 18th, 2025
315
0
6 days
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VIM 0.54 KB | Software | 0 0
  1. inoremap <silent><expr> <TAB>
  2.       \ pumvisible() ? coc#_select_confirm() :
  3.       \ coc#expandableOrJumpable() ?
  4.       \ "\<C-r>=coc#rpc#request('doKeymap', ['snippets-expand-jump',''])\<CR>" :
  5.       \ CheckBackSpace() ? "\<TAB>" :
  6.       \ coc#refresh()
  7.  
  8. inoremap <expr><S-TAB> pumvisible() ? "\<C-p>" : "\<C-h>"
  9.  
  10. " inoremap <expr> <TAB> pumvisible() ? "\<C-y>" : "\<C-g>u\<TAB>"
  11.  
  12. function! CheckBackSpace() abort
  13.   let col = col('.') - 1
  14.   return !col || getline('.')[col - 1]  =~# '\s'
  15. endfunction
  16.  
  17. let g:coc_snippet_next = '<tab>'
  18.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement