blob: 8eb748053a107293ce98082a94a5cc5f7879b696 [file] [log] [blame]
Bram Moolenaar009b2592004-10-24 19:18:58 +00001" Vim syntax file
2" Language: tpp - Text Presentation Program
3" Maintainer: Gerfried Fuchs <alfie@ist.org>
4" Filenames: *.tpp
Bram Moolenaar293ee4d2004-12-09 21:34:53 +00005" Last Change: 28. October 2004
Bram Moolenaar009b2592004-10-24 19:18:58 +00006" URL: http://alfie.ist.org/projects/vim/syntax/tpp.vim
7" License: BSD
8"
9" Comments are very welcome - but please make sure that you are commenting on
10" the latest version of this file.
11" SPAM is _NOT_ welcome - be ready to be reported!
12
13" For version 5.x: Clear all syntax items
14" For version 6.x: Quit when a syntax file was already loaded
15if version < 600
16 syntax clear
17elseif exists("b:current_syntax")
18 finish
19endif
20
21if !exists("main_syntax")
22 let main_syntax = 'tpp'
23endif
24
25
26"" list of the legal switches/options
27syn match tppAbstractOptionKey contained "^--\%(author\|title\|date\) *" nextgroup=tppValue
Bram Moolenaar293ee4d2004-12-09 21:34:53 +000028syn match tppPageLocalOptionKey contained "^--\%(heading\|center\|right\|huge\|sethugefont\|exec\) *" nextgroup=tppValue
Bram Moolenaar009b2592004-10-24 19:18:58 +000029syn match tppPageLocalSwitchKey contained "^--\%(horline\|-\|\%(begin\|end\)\%(\%(shell\)\?output\|slide\%(left\|right\|top\|bottom\)\)\|\%(bold\|rev\|ul\)\%(on\|off\)\|withborder\)"
30syn match tppNewPageOptionKey contained "^--newpage *" nextgroup=tppValue
31syn match tppColorOptionKey contained "^--\%(\%(bg\|fg\)\?color\) *"
32syn match tppTimeOptionKey contained "^--sleep *"
33
34syn match tppValue contained ".*"
35syn match tppColor contained "\%(white\|yellow\|red\|green\|blue\|cyan\|magenta\|black\)"
36syn match tppTime contained "\d\+"
37
38syn region tppPageLocalSwitch start="^--" end="$" contains=tppPageLocalSwitchKey oneline
39syn region tppColorOption start="^--\%(\%(bg\|fg\)\?color\)" end="$" contains=tppColorOptionKey,tppColor oneline
40syn region tppTimeOption start="^--sleep" end="$" contains=tppTimeOptionKey,tppTime oneline
41syn region tppNewPageOption start="^--newpage" end="$" contains=tppNewPageOptionKey oneline
Bram Moolenaar293ee4d2004-12-09 21:34:53 +000042syn region tppPageLocalOption start="^--\%(heading\|center\|right\|huge\|sethugefont\|exec\)" end="$" contains=tppPageLocalOptionKey oneline
Bram Moolenaar009b2592004-10-24 19:18:58 +000043syn region tppAbstractOption start="^--\%(author\|title\|date\)" end="$" contains=tppAbstractOptionKey oneline
44
45if main_syntax != 'sh'
46 " shell command
47 if version < 600
48 syn include @tppShExec <sfile>:p:h/sh.vim
49 else
50 syn include @tppShExec syntax/sh.vim
51 endif
52 unlet b:current_syntax
53
54 syn region shExec matchgroup=tppPageLocalOptionKey start='^--exec *' keepend end='$' contains=@tppShExec
55
56endif
57
Bram Moolenaar293ee4d2004-12-09 21:34:53 +000058syn match tppComment "^--##.*$"
Bram Moolenaar009b2592004-10-24 19:18:58 +000059
60" Define the default highlighting.
61" For version 5.7 and earlier: only when not done already
62" For version 5.8 and later: only when an item doesn't have highlighting yet
63if version >= 508 || !exists("did_tpp_syn_inits")
64 if version < 508
65 let did_tpp_syn_inits = 1
66 command -nargs=+ HiLink hi link <args>
67 else
68 command -nargs=+ HiLink hi def link <args>
69 endif
70
71 HiLink tppAbstractOptionKey Special
72 HiLink tppPageLocalOptionKey Keyword
73 HiLink tppPageLocalSwitchKey Keyword
74 HiLink tppColorOptionKey Keyword
75 HiLink tppTimeOptionKey Comment
76 HiLink tppNewPageOptionKey PreProc
77 HiLink tppValue String
78 HiLink tppColor String
79 HiLink tppTime Number
Bram Moolenaar293ee4d2004-12-09 21:34:53 +000080 HiLink tppComment Comment
Bram Moolenaar009b2592004-10-24 19:18:58 +000081 HiLink tppAbstractOption Error
82 HiLink tppPageLocalOption Error
83 HiLink tppPageLocalSwitch Error
84 HiLink tppColorOption Error
85 HiLink tppNewPageOption Error
86 HiLink tppTimeOption Error
87
88 delcommand HiLink
89endif
90
91let b:current_syntax = "tpp"
92
93" vim: ts=8 sw=2