For some reason, outside of my own solution, we got Golang installed on our virtual machines using Debian packages. This particular vim distribution does not bring any benefits to vim, as far as I could tell from the search around it. In any case, I decided to follow the vundle path to quickly deploy goodies for all of these virtual machines. You could probably use this method in a puppet or something, if you want, we did not. Anyway, here is what I did:
Step 1: Install vundle: https://github.com/gmarik/vundle
Step 2: put this line in your .vimrc (This is from here, of course: https://github.com/jnwhiteh/vim-golang ) and then run vim from the command line, for example vim +BundleInstall +qall or from inside vim using :BundleInstall
Bundle 'jnwhiteh/vim-golang'
Step 3: Save this little bash script I hacked like govim.sh or something else, chmod +x govim.sh and ran it as ./govim.sh
Script as follows:
#!/bin/bash mkdir $HOME/.vim/ftdetect mkdir $HOME/.vim/syntax mkdir $HOME/.vim/autoload mkdir $HOME/.vim/autoload/go mkdir $HOME/.vim/ftplugin mkdir $HOME/.vim/ftplugin/go mkdir $HOME/.vim/indent mkdir $HOME/.vim/compiler mkdir $HOME/.vim/plugin mkdir $HOME/.vim/plugin/godoc ln -s $HOME/.vim/bundle/vim-golang/ftdetect/gofiletype.vim $HOME/.vim/ftdetect ln -s $HOME/.vim/bundle/vim-golang/syntax/go.vim $HOME/.vim/syntax/ ln -s $HOME/.vim/bundle/vim-golang/autoload/go/complete.vim $HOME/.vim/autoload/go/ ln -s $HOME/.vim/bundle/vim-golang/ftplugin/go.vim $HOME/.vim/ftplugin/ ln -s $HOME/.vim/bundle/vim-golang/ftplugin/go/*.vim $HOME/.vim/ftplugin/go/ ln -s $HOME/.vim/bundle/vim-golang/indent/go.vim $HOME/.vim/indent/ ln -s $HOME/.vim/bundle/vim-golang/compiler/go.vim $HOME/.vim/compiler/ ln -s $HOME/.vim/bundle/vim-golang/plugin/godoc/godoc.vim $HOME/.vim/plugin/godoc/ ln -s $HOME/.vim/bundle/vim-golang/syntax/godoc.vim $HOME/.vim/syntax/
Kaching! Now you have all the useful properties, and someone will correct me if I am wrong about this, but maybe more than what comes with the official Golang distribution. I don't know about this without even trying it, but I think runtimepath / rtp gets clobbered if you use Vundle with other answers here anyway here anyway.
Dmitri DB Jan 02 '14 at 22:23 2014-01-02 22:23
source share