In my .vimrc file I have
syntax off
Suppose I want to turn on syntax highlighting on a case-by-case basis via vim's modeline? I've tried many combinations, like:
# vim: syntax on:
but I still can't get it to work. What do I need to do in the modeline?
According to
:help syntax, usingsyntax enableorsyntax onloads syntax files at runtime. But there's also apparentlysyntax manualwhich turns it on based on the syntax type you specify. Looking at the source vimscript, it says:You can therefore use
syntax=to set the type, and that works in a modeline to either set a specific type or setnonewhich effectively turns it off.If you want to be explicit about disabling it in a file: