I've been so far unable to figure out why vim's syntax coloring is not working for most files, and it's driving me batty.
In case this is relevant: I'm working in Cygwin (more specifically/accurately the bash shell that comes with Git for Windows) because it's the only thing I've been able to smuggle into this Windows shop so far. (I sometimes bring in my MacBook Air but it is somewhat frowned upon. Also, as with most Windows shops they're paranoid about installing software, so a full Cygwin installation would need justification. Also, I'm not using gvim because I prefer to work with vim in a terminal.)
I can get syntax coloring to work if I tell vim that the file is C++
:set syntax=cpp
or if it is a shell script, but not if I'm working in Ruby or PHP.
I've ensured that syntax is turned on with both :syntax on
and :syntax enable
.
I've tried installing vim syntax files in ~/.vim/syntax/<syntax-type>.vim
but this has not made a difference.
I've ensured files had the standard file extension, so if working with a Vagrantfile I tried adding '.rb', and I've tried avoiding my .vimrc file (as well as tried other .vimrc files):
vim -u /dev/null Vagrantfile.rb
I've also ensured Ruby files had the normal 'shebang' line.
Nothing has worked so far.
What could prevent vim from properly coloring certain files?
c:\cygwin
default to%USERPROFILE%\cygwin
or similar, thus avoiding any need for admin permissions. Since Cygwin 1.7, Cygwin doesn't use the registry any more, except for one optional thing for the convenience ofsetup.exe
. You probably need admin perms to install a background service, but Cygwin is plenty useful without those. Cygwin is essentially self-contained.syntax on
somewhere as well?:syntax on
and:syntax enable
several times. (I'll add that to the question. Thanks.)