xref: /vim-8.2.3635/runtime/syntax/tpp.vim (revision 0fa313a7)
1" Vim syntax file
2" Language:	tpp - Text Presentation Program
3" Maintainer:	Gerfried Fuchs <[email protected]>
4" Filenames:	*.tpp
5" Last Change:	28. October 2004
6" 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
28syn match tppPageLocalOptionKey contained "^--\%(heading\|center\|right\|huge\|sethugefont\|exec\) *" nextgroup=tppValue
29syn 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
42syn region tppPageLocalOption start="^--\%(heading\|center\|right\|huge\|sethugefont\|exec\)" end="$" contains=tppPageLocalOptionKey oneline
43syn 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
58syn match tppComment "^--##.*$"
59
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
80  HiLink tppComment			Comment
81  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
94