即使安装了vim-gocode,我也无法自动完成Go代码

My setup

I already installed gocode with the command go get github.com/nsf/gocode.

I use Pathogen to manage my Vim plugins. I installed vim-gocode with git clone git@github.com:Blackrush/vim-gocode.git.

What I’m seeing

The :Fmt command works ok, but I can’t autocomplete my golang code. It reports an error like in this image:

E117: Unknown function: go#complete#Complete

Can someone help me?

Please ensure you have YCM or neocomplete installed. You need some additional binaries to get all features. Following on the vim-go repo tells you how to install them.

All necessary binaries should be installed (such as gocode, godef, goimports, etc.). You can easily install them with the included :GoInstallBinaries command, by running command in your vim.