1 " Vim syntax support file
2 " Maintainer: Bram Moolenaar <Bram@vim.org>
3 " Last Change: 2012 Sep 25
5 " This file sets up for syntax highlighting.
6 " It is loaded from "syntax.vim" and "manual.vim".
7 " 1. Set the default highlight groups.
8 " 2. Install Syntax autocommands for all the available syntax files.
14 " let others know that syntax has been switched on
17 " Set the default highlighting colors. Use a color scheme if specified.
18 if exists("colors_name")
19 exe "colors " . colors_name
21 runtime! syntax/syncolor.vim
24 " Line continuation is used here, remove 'C' from 'cpoptions'
28 " First remove all old syntax autocommands.
31 au Syntax * call s:SynSet()
34 " clear syntax for :set syntax=OFF and any syntax name that doesn't exist
36 if exists("b:current_syntax")
37 unlet b:current_syntax
40 let s = expand("<amatch>")
45 echo "filetype unknown"
54 " Load the syntax file(s). When there are several, separated by dots,
55 " load each in sequence.
56 for name in split(s, '\.')
57 exe "runtime! syntax/" . name . ".vim syntax/" . name . "/*.vim"
63 " Handle adding doxygen to other languages (C, C++, C#, IDL)
64 au Syntax c,cpp,cs,idl,php
65 \ if (exists('b:load_doxygen_syntax') && b:load_doxygen_syntax)
66 \ || (exists('g:load_doxygen_syntax') && g:load_doxygen_syntax)
67 \ | runtime! syntax/doxygen.vim
71 " Source the user-specified syntax highlighting file
72 if exists("mysyntaxfile") && filereadable(expand(mysyntaxfile))
73 execute "source " . mysyntaxfile