blob: c57b6f87118834671f3fc16e8dc7252059d1e1b3 [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
37command -nargs=+ HiLink hi def link <args>
38HiLink CfgOnOff Label
39HiLink CfgComment Comment
40HiLink CfgSection Type
41HiLink CfgString String
42HiLink CfgParams Keyword
43HiLink CfgValues Constant
44HiLink CfgDirectory Directory
45HiLink UncPath Directory
Bram Moolenaar071d4272004-06-13 20:20:40 +000046
Bram Moolenaar89bcfda2016-08-30 23:26:57 +020047delcommand HiLink
48
Bram Moolenaar071d4272004-06-13 20:20:40 +000049let b:current_syntax = "cfg"
50" vim:ts=8