Using the Go Syntax for Janus VIM

Dec 10 2012

To add the Go language (golang) plugins to Janus-flavored VIM, it's not enough to install the VIM plugins into your system's default location. So using, for example, Ubuntu's vim-syntax-go package will not work.

The best way to install all of the Go VIM plugins is to do the following:

  • Create a directory in your .janus directory for the go VIM plugin: mkdir ~/.janus/go
  • Download a fresh copy of the Go source: hg clone https://code.google.com/p/go/ (you may need to sudo apt-get install mercurial first)
  • Inside of the go/misc directory, find the vim directory
  • Copy the contents of the vim directory to the .janus/go directory: cp -a vim/* ~/.janus/go.
  • Restart VIM

This will give VIM access to all of the Go plugins. Syntax highlighting should immediately work on all *.go files. <!--break-->