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