Gocode Vim Plugin and Go Modules
Update: My friend Eli Uriegas let me know that you don’t need gocode
anymore since vim-go
has autocompletion. I tested it out and he is correct. Here is his tweet with a link to his dotfiles on how he sets up his .vimrc
to use vim-go
Original Post:
I recently purchased Let’s Go from Alex Edwards. I wanted an end-to-end Golang website tutorial. It has been great. Lots learned.
Unfortunately, he is using Go’s modules and the version of the gocode Vim plugin I was using did not support Go modules.
Solution
Use this fork of the gocode Vim plugin and you’ll get support for Go modules.
I use Vim Plug for my Vim plugins. Huge fan of Vundle but I like the post-actions feature of Plug. I just had to change one line of my vimrc and re-run updates.
|
|
That is the line I had to change then run :PlugUpdate!
and the new plugin was installed.
I figured all of this out due to this comment by Tommaso Sardelli on Github. Thank you Tommaso.