1" Vim syntax file 2" Language: Good old CFG files 3" Maintainer: Igor N. Prischepoff ([email protected], [email protected]) 4" Last change: 2012 Aug 11 5 6" quit when a syntax file was already loaded 7if exists ("b:current_syntax") 8 finish 9endif 10 11" case off 12syn case ignore 13syn keyword CfgOnOff ON OFF YES NO TRUE FALSE contained 14syn match UncPath "\\\\\p*" contained 15"Dos Drive:\Path 16syn match CfgDirectory "[a-zA-Z]:\\\p*" contained 17"Parameters 18syn match CfgParams ".\{0}="me=e-1 contains=CfgComment 19"... and their values (don't want to highlight '=' sign) 20syn match CfgValues "=.*"hs=s+1 contains=CfgDirectory,UncPath,CfgComment,CfgString,CfgOnOff 21 22" Sections 23syn match CfgSection "\[.*\]" 24syn match CfgSection "{.*}" 25 26" String 27syn match CfgString "\".*\"" contained 28syn match CfgString "'.*'" contained 29 30" Comments (Everything before '#' or '//' or ';') 31syn match CfgComment "#.*" 32syn match CfgComment ";.*" 33syn match CfgComment "\/\/.*" 34 35" Define the default highlighting. 36" Only when an item doesn't have highlighting yet 37hi def link CfgOnOff Label 38hi def link CfgComment Comment 39hi def link CfgSection Type 40hi def link CfgString String 41hi def link CfgParams Keyword 42hi def link CfgValues Constant 43hi def link CfgDirectory Directory 44hi def link UncPath Directory 45 46 47let b:current_syntax = "cfg" 48" vim:ts=8 49