Vim-go: syntax highlighting not working for me

Created on 14 Feb 2015  路  2Comments  路  Source: fatih/vim-go

It was working IIRC, however opened a .go file and _poof_ no syntax highlighting.

Not sure what happened.

I set
:set syntax=on
:set filetype=go

and I got a little highlighting (green func call and blue strings). But definitly not complete.

YCM is still working and I can run :GoIMports etc.

Most helpful comment

Some of the options are disabled because they syntax highlighting is slow on slow machines. To enable them add these to your vimrcs:

let g:go_highlight_structs = 1 
let g:go_highlight_methods = 1
let g:go_highlight_functions = 1
let g:go_highlight_operators = 1
let g:go_highlight_build_constraints = 1

Check out the doc for even more options to enable/disable:

https://github.com/fatih/vim-go/blob/master/doc/vim-go.txt#L502

Also sometimes you need to call :set syntax=enable, especially of Vim GUI's, but I think your problem is the one I've listed above. I'll add this to the FAQ, because I've received a lot of issues like this.

All 2 comments

Some of the options are disabled because they syntax highlighting is slow on slow machines. To enable them add these to your vimrcs:

let g:go_highlight_structs = 1 
let g:go_highlight_methods = 1
let g:go_highlight_functions = 1
let g:go_highlight_operators = 1
let g:go_highlight_build_constraints = 1

Check out the doc for even more options to enable/disable:

https://github.com/fatih/vim-go/blob/master/doc/vim-go.txt#L502

Also sometimes you need to call :set syntax=enable, especially of Vim GUI's, but I think your problem is the one I've listed above. I'll add this to the FAQ, because I've received a lot of issues like this.

Awesome, thanks. that resolved it.

G

Was this page helpful?
0 / 5 - 0 ratings

Related issues

andrejvanderzee picture andrejvanderzee  路  3Comments

mnarrell picture mnarrell  路  3Comments

johnzeng picture johnzeng  路  3Comments

danielmanesku picture danielmanesku  路  4Comments

korjavin picture korjavin  路  4Comments