Simplify coc.vim config

657e26b16b55247b8a52e2164e4a53a0083e47aa
Alexis Sellier committed ago 1 parent bf09c400
.vimrc +2 -6
415 415
  nmap <silent> gj           <Plug>(coc-diagnostic-next)
416 416
  nmap <silent> gk           <Plug>(coc-diagnostic-prev)
417 417
  nmap <silent> <leader>/    :CocList --interactive symbols<CR>
418 418
  nmap <silent> <leader>r    <Plug>(coc-rename)
419 419
420 -
  " This is a kind of hack to make <C-Y> not trigger snippet expansion.
421 -
  " We use <C-p><C-n> to insert the selection without triggering anything, and
422 -
  " then close the popup.
423 -
  inoremap <silent><expr> <C-Y> pumvisible() ? "<C-p><C-n><Esc>a" : "\<C-Y>"
424 -
  " Trigger completion on <CR>.
425 -
  inoremap <expr> <cr> pumvisible() ? "\<C-y>" : "\<C-g>u\<CR>"
420 +
  inoremap <expr> <cr> coc#pum#visible() ? coc#_select_confirm() : "\<CR>"
426 421
endfunction
422 +
427 423
autocmd User CocNvimInit call SetupCoc()
428 424
command! CocStop call coc#rpc#stop()
429 425
430 426
431 427
" Use custom colors.