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