" below is for using ENTER for completion, I actually don't like it, CTRL+Y works better for me, you can omit this part if you are like me inoremap <silent><expr> <cr> coc#pum#visible() && coc#pum#info()['index'] != -1 ? coc#pum#confirm() : \ "\<C-g>u\<CR>\<c-r>=coc#on_enter()\<CR>"