blob: a50297d418fd27d7918994ab0fed8c600023948f [file] [log] [blame]
Bram Moolenaar071d4272004-06-13 20:20:40 +00001" Vim syntax file
2" Language: Good old CFG files
3" Maintainer: Igor N. Prischepoff (igor@tyumbit.ru, pri_igor@mail.ru)
Bram Moolenaar9b451252012-08-15 17:43:31 +02004" Last change: 2012 Aug 11
Bram Moolenaar071d4272004-06-13 20:20:40 +00005
Bram Moolenaar89bcfda2016-08-30 23:26:57 +02006" quit when a syntax file was already loaded
7if exists ("b:current_syntax")
Bram Moolenaar071d4272004-06-13 20:20:40 +00008 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
Bram Moolenaar9b451252012-08-15 17:43:31 +020018syn match CfgParams ".\{0}="me=e-1 contains=CfgComment
Bram Moolenaar071d4272004-06-13 20:20:40 +000019"... 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 hightlighting.
Bram Moolenaar89bcfda2016-08-30 23:26:57 +020036" Only when an item doesn't have highlighting yet
Bram Moolenaarf37506f2016-08-31 22:22:10 +020037hi 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
Bram Moolenaar071d4272004-06-13 20:20:40 +000045
Bram Moolenaar89bcfda2016-08-30 23:26:57 +020046
Bram Moolenaar071d4272004-06-13 20:20:40 +000047let b:current_syntax = "cfg"
48" vim:ts=8