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 |
| 37 | command -nargs=+ HiLink hi def link <args> |
| 38 | HiLink CfgOnOff Label |
| 39 | HiLink CfgComment Comment |
| 40 | HiLink CfgSection Type |
| 41 | HiLink CfgString String |
| 42 | HiLink CfgParams Keyword |
| 43 | HiLink CfgValues Constant |
| 44 | HiLink CfgDirectory Directory |
| 45 | HiLink UncPath Directory |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 46 | |
Bram Moolenaar | 89bcfda | 2016-08-30 23:26:57 +0200 | [diff] [blame] | 47 | delcommand HiLink |
| 48 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 49 | let b:current_syntax = "cfg" |
| 50 | " vim:ts=8 |