I'm using Vim version 7.1.145 and all I've got in my ~/.vimrc file is:
syntax on
and all of my files are completely syntax highlighted (if that's correct
English) - *.c, *.html, *.conf, *.vimrc etc. All of them.
Don't know if this helps?
Cheers,
Steve (BM)
I think each syntax scripts sets syn sync for the files it highlights.
You might want top place your syn sync command in some after-script, e.g.
(Unix) $HOME/.vim/after/syntax/html.vim
(Windows) $HOME/vimfiles/after/syntax/html.vim
Create the directories if they don't exist yet.
Best regards,
Tony.
--
"I am not an Economist. I am an honest man!"
-- Paul McCracken
When each file loads, it loads the syntax for that file, which usually
contains sync commands which override the earlier one in your vimrc.
One solution is to use after files for each filetype to override this by
creating files for the different filetypes you edit where you want this
different behaviour, e.g. for c, you create ~/.vim/after/syntax/c.vim
and put your command in that (create necessary parent directories).
Another is using an autocommand to run the command automatically after
the syntax changes
:au Syntax * syntax sync fromstart
This command must be in your vimrc after the syntax highlighting is
turned on, or it will happen before the syntax change still!
By replacing the * with some other pattern you can make it apply to only
specific syntaxes if you desire, too.
Also note that 'fromstart' should be one word, I believe.
Ben.