Autocomplete with Vim-Go and Neovim in 2022

Vim-Go uses gopls for autocompletion. By default, it relies on Ctrl-x Ctrl-o to trigger it. To trigger it automatically in Neovim, use Deoplete.

I’m using Vim-Plug. This is the relevant snippet of .vimrc which makes automatic triggering works.

call plug#begin(expand('~/nvim/plugged'))

...
Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' }
let g:deoplete#enable_at_startup = 1
...
call plug#end()

call deoplete#custom#option('omni_patterns', {
\ 'go': '[^. *\t]\.\w*',
\})


Date
April 27, 2022