Home > Uncategorized > Vim Syntax File for go

Vim Syntax File for go

November 22nd, 2009 Leave a comment Go to comments

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 Tags:
  1. November 22nd, 2009 at 21:34 | #1

    Wow, thanks. I was having the same issue and this cleared it up quick.

  1. No trackbacks yet.