Vim as Go language IDE
:fire: UPD: JetBrains has an amazing Golang IDE now!
There are plugins for Sublime, IntelliJ IDEA, Komodo etc so why do we need to do this for Vim?
Honestly, those plugins suck big time - they are hard to install, they are limited, they are not developed at fast enough pace. Don’t get me wrong, I will gladly switch to full-fledged Go IDE once it is ready, but before that, I am more productive on my default environment of choice i.e. Vim.
1. Discrete Runtime
Actually, nothing holds us from being productive right away. We already have:
- amazing tools (gofmt, gocode, godef etc)
- amazing Vim plugins
The only problem is that Vim plugins and settings are being installed directly into your
.vim. Therefore, it is
hard to just try some setup.
I decided to create a simple runtime configuration that will be trivial to install (and uninstall!) and try.
So, without further ado, here we go: vim-go-ide.
Installation is as trivial as:
1git clone firstname.lastname@example.org:farazdagi/vim-go-ide.git ~/.vim_go_runtime 2sh ~/.vim_go_runtime/bin/install
i.e. you clone the repository into
~/.vim_go_runtime and run a script (which will create custom vimrc and write it as
Since we haven’t touched
~/.vimrc, system’s configuration stays intact!
Time to see newly installed configuration in action:
1vim -u ~/.vimrc.go
2. Non-Go (but essential) plugins
Here is a list of goodies (coming with this runtime) that are not Go-related but absolutely necessary for productive development environment:
3. Go-related plugins
The only Go-related Vim plugin you will ever need (the One to rule them all!!):
To make sure that all extra Go tools (godep, gocode etc) are present on your system, just run the following command from within Vim:
4. How to use and extend
I highly recommend reviewing the
.vimrc.go file - it has lots of clever tricks.
To extend Vim’s configuration, create/edit the
.vim_go_runtime/custom_config.vim file and re-run installation script (actually look into
its code to get the idea what it does).
Q.1 How to uninstall?
What, already? Well, if you absolutely need to:
rm ~/.vim_go_runtime rm ~/.vimrc.go
Q.2 Who should I thank for this amazing work?
The work I’ve done is trivial (although I hope you will still find it useful).
This setup is heavily based on amiz/vimrc. Should you need some place to start with your Vim setup, there’s hardly a better place!
Now, when it comes to Go awesomeness - vim-go is all that we needed!
Q3. Which version of Vim was used?
I am using OS X Mavericks and it comes with Vim 7.3 without lua support (which is required by neocomplete plugin).
brew install vim --with-lua --override-system-vim
Q4. Can I see how it all looks like?