Skip to content

FAQ Troubleshooting

Martin Tournoij edited this page Aug 1, 2016 · 8 revisions

Why another plugin?

This plugin/package is born mainly from frustration. I had to re-install my Vim plugins and especially for Go I had to install a lot of separate different plugins, setup the necessary binaries to make them work together and hope not to lose them again. Lots of plugins out there lack proper settings. This plugin is improved and contains all my fixes/changes that I'm using for months under heavy go development environment.

Give it a try. I hope you like it. Feel free to contribute to the project.

I get "not an editor command" error when I invoke :GoXXX

This happens if vim-go is not installed properly. Be sure you have added this line into your .vimrc:

filetype plugin indent on

I get a "command not found" error when I invoke :GoXXX

If you try to call :GoDef, :GoInfo and get a command not found, check that you have the binaries installed by using: :GoInstallBinaries

Before opening vim, check your current $PATH:

echo $PATH

after opening vim, run :echo $PATH, the output must be your current $PATH + $GOPATH/bin (the location where :GoInstallBinaries installed the binaries

Go tools use a different $GOPATH than what VIM started with.

Check the sourcing order of your shell. For example in ZSH .zshenv applies even to non-interactive shells, which VIM uses to run all the GO tools. Values set in such file will override the shell which VIM started with. You can try one of the following:

  • Move your $GOPATH settings to the right files that is not sourced by non-interactive shells or...
  • Set your VIM's shell variable to a different shell set shell='/bin/sh'

Vim becomes sluggish while editing Go files

Don't enable these options:

let g:go_highlight_structs = 0
let g:go_highlight_interfaces = 0
let g:go_highlight_operators = 0