2 " Language: Good old CFG files
3 " Maintainer: Igor N. Prischepoff (igor@tyumbit.ru, pri_igor@mail.ru)
4 " Last change: 2001 Sep 02
6 " For version 5.x: Clear all syntax items
7 " For version 6.x: Quit when a syntax file was already loaded
10 elseif exists ("b:current_syntax")
16 syn keyword CfgOnOff ON OFF YES NO TRUE FALSE contained
17 syn match UncPath "\\\\\p*" contained
19 syn match CfgDirectory "[a-zA-Z]:\\\p*" contained
21 syn match CfgParams ".*="me=e-1 contains=CfgComment
22 "... and their values (don't want to highlight '=' sign)
23 syn match CfgValues "=.*"hs=s+1 contains=CfgDirectory,UncPath,CfgComment,CfgString,CfgOnOff
26 syn match CfgSection "\[.*\]"
27 syn match CfgSection "{.*}"
30 syn match CfgString "\".*\"" contained
31 syn match CfgString "'.*'" contained
33 " Comments (Everything before '#' or '//' or ';')
34 syn match CfgComment "#.*"
35 syn match CfgComment ";.*"
36 syn match CfgComment "\/\/.*"
38 " Define the default hightlighting.
39 " For version 5.7 and earlier: only when not done already
40 " For version 5.8 and later: only when an item doesn't have highlighting yet
41 if version >= 508 || !exists("did_cfg_syn_inits")
43 let did_cfg_syn_inits = 1
44 command -nargs=+ HiLink hi link <args>
46 command -nargs=+ HiLink hi def link <args>
49 HiLink CfgComment Comment
50 HiLink CfgSection Type
51 HiLink CfgString String
52 HiLink CfgParams Keyword
53 HiLink CfgValues Constant
54 HiLink CfgDirectory Directory
55 HiLink UncPath Directory
59 let b:current_syntax = "cfg"