Vim Syntax File for go
While installing go, configuring vim syntax took longer than it should – would have been easier if I had known the following:
mkdir ~/.vim/ftdetect and ~/.vim/syntax if they don’t exist
vi ~/.vim/ftdetect/go.vim
containing:
au BufRead,BufNewFile *.go set filetype=go
copy go.vim to $GOROOT/misc/vim/go.vim to ~/.vim/syntax/
And of course, make sure you are running vim-enhanced and not vim-tiny, as tiny doesn’t support syntax highlighting.
Categories: Uncategorized
Wow, thanks. I was having the same issue and this cleared it up quick.