René Nyffenegger's collection of things on the web
René Nyffenegger on Oracle - Most wanted - Feedback -
 

syntax [VIM]

:syntax on

:syntax on basically sources the file syntax.vim.
syntax.vim has a line with
runtime syntax/synload.vim
which sources the file syntax/synload.vim
Then, a
filetype on on
is executed (which loads filetype.vim)
Finally, there's a line
au! FileType *	exe "set syntax=" . expand("<amatch>")
which sets up the connection between FileType and Syntax autocommands.

synload.vim

synload.vim does a
runtime! syntax/syncolor.vim
which loads syntax/syncolor.vim

syncolor.vim

syncolor.vim defines highlights and some links to these highlights:
  • Comment, linked to by
    n/a
  • Constant , linked to by
    String, Character, NUmber, Boolean
  • Special , linked to by
    Tag, SpecialChar, Delimiter, SpecialComment, Debug
  • Identifier , linked to by
    Function
  • Statement , linked to by
    Conditional, Repeat, Label, Operator, Keyword, Exception
  • PreProc , linked to by
    Include, Define, Macro, PreCondit
  • Type , linked to by
    StorageClass, Structure, Typedef
  • Underlined , linked to by
  • Ignore , linked to by
    n/a

syntax enable/on/manual/off

The syntax on, syntax on, syntax on and syntax on do actually source a file.
:syntax on and syntax enable source $VIMRUNTIME/syntax/syntax.vim. :syntax manual sources $VIMRUNTIME/syntax/manual.vim. :syntax off sources $VIMRUNTIME/syntax/nosyntax.vim.

syntax_cmd

This variable is set in syncolor.vim to one of
  • on
  • enable
  • reset
  • skip