Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1 | " Vim syntax file |
| 2 | " Language: mgp - MaGic Point |
| 3 | " Maintainer: Gerfried Fuchs <alfie@ist.org> |
| 4 | " Filenames: *.mgp |
| 5 | " Last Change: 25 Apr 2001 |
| 6 | " URL: http://alfie.ist.org/vim/syntax/mgp.vim |
| 7 | " |
| 8 | " Comments are very welcome - but please make sure that you are commenting on |
| 9 | " the latest version of this file. |
| 10 | " SPAM is _NOT_ welcome - be ready to be reported! |
| 11 | |
| 12 | |
| 13 | " For version 5.x: Clear all syntax items |
| 14 | " For version 6.x: Quit when a syntax file was already loaded |
| 15 | if version < 600 |
| 16 | syn clear |
| 17 | elseif exists("b:current_syntax") |
| 18 | finish |
| 19 | endif |
| 20 | |
| 21 | |
| 22 | syn match mgpLineSkip "\\$" |
| 23 | |
| 24 | " all the commands that are currently recognized |
| 25 | syn keyword mgpCommand contained size fore back bgrad left leftfill center |
| 26 | syn keyword mgpCommand contained right shrink lcutin rcutin cont xfont vfont |
| 27 | syn keyword mgpCommand contained tfont tmfont tfont0 bar image newimage |
| 28 | syn keyword mgpCommand contained prefix icon bimage default tab vgap hgap |
| 29 | syn keyword mgpCommand contained pause mark again system filter endfilter |
| 30 | syn keyword mgpCommand contained vfcap tfdir deffont font embed endembed |
| 31 | syn keyword mgpCommand contained noop pcache include |
| 32 | |
| 33 | " charset is not yet supported :-) |
| 34 | " syn keyword mgpCommand contained charset |
| 35 | |
| 36 | syn region mgpFile contained start=+"+ skip=+\\\\\|\\"+ end=+"+ |
| 37 | syn match mgpValue contained "\d\+" |
| 38 | syn match mgpSize contained "\d\+x\d\+" |
| 39 | syn match mgpLine +^%.*$+ contains=mgpCommand,mgpFile,mgpSize,mgpValue |
| 40 | |
| 41 | " Comments |
| 42 | syn match mgpPercent +^%%.*$+ |
| 43 | syn match mgpHash +^#.*$+ |
| 44 | |
| 45 | " these only work alone |
| 46 | syn match mgpPage +^%page$+ |
| 47 | syn match mgpNoDefault +^%nodefault$+ |
| 48 | |
| 49 | |
| 50 | " Define the default highlighting. |
| 51 | " For version 5.7 and earlier: only when not done already |
| 52 | " For version 5.8 and later: only when an item doesn't have highlighting yet |
| 53 | if version >= 508 || !exists("did_mgp_syn_inits") |
| 54 | let did_mgp_syn_inits = 1 |
| 55 | if version < 508 |
| 56 | let did_mgp_syn_inits = 1 |
| 57 | command -nargs=+ HiLink hi link <args> |
| 58 | else |
| 59 | command -nargs=+ HiLink hi def link <args> |
| 60 | endif |
| 61 | |
| 62 | HiLink mgpLineSkip Special |
| 63 | |
| 64 | HiLink mgpHash mgpComment |
| 65 | HiLink mgpPercent mgpComment |
| 66 | HiLink mgpComment Comment |
| 67 | |
| 68 | HiLink mgpCommand Identifier |
| 69 | |
| 70 | HiLink mgpLine Type |
| 71 | |
| 72 | HiLink mgpFile String |
| 73 | HiLink mgpSize Number |
| 74 | HiLink mgpValue Number |
| 75 | |
| 76 | HiLink mgpPage mgpDefine |
| 77 | HiLink mgpNoDefault mgpDefine |
| 78 | HiLink mgpDefine Define |
| 79 | |
| 80 | delcommand HiLink |
| 81 | endif |
| 82 | |
| 83 | let b:current_syntax = "mgp" |