Search code examples
govimeditorcoc.nvimvim-go

Go: vim autocomplete <ENTER> command don't works


autocomplete in vim doesn't work when I hit ENTER and the cursor go to the next line.

this is my .vimrc configuration: https://github.com/marcosvidolin/dotfiles/blob/master/.vimrc

Popup example:

enter image description here

Thanks


Solution

  • you need to add this to your .vimrc

    inoremap <silent><expr> <cr> coc#pum#visible() ? coc#_select_confirm() : "\<C-g>u\<CR>"
    

    source : Completion with sources