1" Vim syntax file 2" Language: Good old CFG files 3" Maintainer: Igor N. Prischepoff ([email protected], [email protected]) 4" Last change: 2001 Sep 02 5 6" For version 5.x: Clear all syntax items 7" For version 6.x: Quit when a syntax file was already loaded 8if version < 600 9 syntax clear 10elseif exists ("b:current_syntax") 11 finish 12endif 13 14" case off 15syn case ignore 16syn keyword CfgOnOff ON OFF YES NO TRUE FALSE contained 17syn match UncPath "\\\\\p*" contained 18"Dos Drive:\Path 19syn match CfgDirectory "[a-zA-Z]:\\\p*" contained 20"Parameters 21syn match CfgParams ".*="me=e-1 contains=CfgComment 22"... and their values (don't want to highlight '=' sign) 23syn match CfgValues "=.*"hs=s+1 contains=CfgDirectory,UncPath,CfgComment,CfgString,CfgOnOff 24 25" Sections 26syn match CfgSection "\[.*\]" 27syn match CfgSection "{.*}" 28 29" String 30syn match CfgString "\".*\"" contained 31syn match CfgString "'.*'" contained 32 33" Comments (Everything before '#' or '//' or ';') 34syn match CfgComment "#.*" 35syn match CfgComment ";.*" 36syn match CfgComment "\/\/.*" 37 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 41if version >= 508 || !exists("did_cfg_syn_inits") 42 if version < 508 43 let did_cfg_syn_inits = 1 44 command -nargs=+ HiLink hi link <args> 45 else 46 command -nargs=+ HiLink hi def link <args> 47 endif 48 HiLink CfgOnOff Label 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 56 57 delcommand HiLink 58endif 59let b:current_syntax = "cfg" 60" vim:ts=8 61