Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Vim filetype detection does not trigger syntax highlighting

Tags:

vim

I'm trying to detect Go files in vim. I've set this up normally on other computers but this one is stuck.

:set filetype?
filetype=go

So it knows that it's a go file, but isn't triggering the syntax highlighting.

However,

:set filetype=go

triggers it correctly.

:filetype detect 

doesn't work, and reopening the file :e! turns syntax highlighting off, even though filetype remains set to "go".

I have

set rtp+=/usr/local/go/misc/vim
filetype plugin indent on
syntax on

in my .vimrc (as the instructions say).

What's going on? I suspect there's some other configuration that's undoing the syntax highlighting, but lack the knowledge of where to find it.

like image 604
Dijkstra Avatar asked Oct 22 '12 10:10

Dijkstra


1 Answers

I'm not sure exactly what the problem is… However, you can try :scriptnames to see what files were loaded by Vim.

One step further, you can set verbose=9 in your .vimrc and restart Vim. Careful, this is really verbose, try to tweak that number down.

like image 76
jpalardy Avatar answered Oct 15 '22 22:10

jpalardy