blob: e2b307b2a21c74e317ac380eb09aa794924e0737 [file] [log] [blame]
Bram Moolenaar009b2592004-10-24 19:18:58 +00001" Vim syntax file
Bram Moolenaar4c05fa02019-01-01 15:32:17 +01002" Language: tpp - Text Presentation Program
3" Maintainer: Debian Vim Maintainers
4" Former Maintainer: Gerfried Fuchs <alfie@ist.org>
Bram Moolenaarbe4e0162023-02-02 13:59:48 +00005" Last Change: 2023 Jan 16
6" URL: https://salsa.debian.org/vim-team/vim-debian/blob/main/syntax/tpp.vim
Bram Moolenaar4c05fa02019-01-01 15:32:17 +01007" Filenames: *.tpp
8" License: BSD
Bram Moolenaar009b2592004-10-24 19:18:58 +00009"
Bram Moolenaara93fa7e2006-04-17 22:14:47 +000010" XXX This file is in need of a new maintainer, Debian VIM Maintainers maintain
11" it only because patches have been submitted for it by Debian users and the
12" former maintainer was MIA (Missing In Action), taking over its
13" maintenance was thus the only way to include those patches.
14" If you care about this file, and have time to maintain it please do so!
15"
Bram Moolenaar009b2592004-10-24 19:18:58 +000016" Comments are very welcome - but please make sure that you are commenting on
17" the latest version of this file.
18" SPAM is _NOT_ welcome - be ready to be reported!
19
Bram Moolenaar89bcfda2016-08-30 23:26:57 +020020" quit when a syntax file was already loaded
Bram Moolenaar4c05fa02019-01-01 15:32:17 +010021if exists('b:current_syntax')
Bram Moolenaar009b2592004-10-24 19:18:58 +000022 finish
23endif
24
Bram Moolenaar4c05fa02019-01-01 15:32:17 +010025if !exists('main_syntax')
Bram Moolenaar009b2592004-10-24 19:18:58 +000026 let main_syntax = 'tpp'
27endif
28
29
30"" list of the legal switches/options
Bram Moolenaara93fa7e2006-04-17 22:14:47 +000031syn match tppAbstractOptionKey contained "^--\%(author\|title\|date\|footer\) *" nextgroup=tppString
32syn match tppPageLocalOptionKey contained "^--\%(heading\|center\|right\|huge\|sethugefont\|exec\) *" nextgroup=tppString
Bram Moolenaar009b2592004-10-24 19:18:58 +000033syn match tppPageLocalSwitchKey contained "^--\%(horline\|-\|\%(begin\|end\)\%(\%(shell\)\?output\|slide\%(left\|right\|top\|bottom\)\)\|\%(bold\|rev\|ul\)\%(on\|off\)\|withborder\)"
Bram Moolenaara93fa7e2006-04-17 22:14:47 +000034syn match tppNewPageOptionKey contained "^--newpage *" nextgroup=tppString
Bram Moolenaar009b2592004-10-24 19:18:58 +000035syn match tppColorOptionKey contained "^--\%(\%(bg\|fg\)\?color\) *"
36syn match tppTimeOptionKey contained "^--sleep *"
37
Bram Moolenaara93fa7e2006-04-17 22:14:47 +000038syn match tppString contained ".*"
39syn match tppColor contained "\%(white\|yellow\|red\|green\|blue\|cyan\|magenta\|black\|default\)"
Bram Moolenaar009b2592004-10-24 19:18:58 +000040syn match tppTime contained "\d\+"
41
42syn region tppPageLocalSwitch start="^--" end="$" contains=tppPageLocalSwitchKey oneline
43syn region tppColorOption start="^--\%(\%(bg\|fg\)\?color\)" end="$" contains=tppColorOptionKey,tppColor oneline
44syn region tppTimeOption start="^--sleep" end="$" contains=tppTimeOptionKey,tppTime oneline
45syn region tppNewPageOption start="^--newpage" end="$" contains=tppNewPageOptionKey oneline
Bram Moolenaar293ee4d2004-12-09 21:34:53 +000046syn region tppPageLocalOption start="^--\%(heading\|center\|right\|huge\|sethugefont\|exec\)" end="$" contains=tppPageLocalOptionKey oneline
Bram Moolenaara93fa7e2006-04-17 22:14:47 +000047syn region tppAbstractOption start="^--\%(author\|title\|date\|footer\)" end="$" contains=tppAbstractOptionKey oneline
Bram Moolenaar009b2592004-10-24 19:18:58 +000048
Bram Moolenaar4c05fa02019-01-01 15:32:17 +010049if main_syntax !=# 'sh'
Bram Moolenaar009b2592004-10-24 19:18:58 +000050 " shell command
Bram Moolenaar89bcfda2016-08-30 23:26:57 +020051 syn include @tppShExec syntax/sh.vim
Bram Moolenaar009b2592004-10-24 19:18:58 +000052 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.
Bram Moolenaar89bcfda2016-08-30 23:26:57 +020061" Only when an item doesn't have highlighting yet
Bram Moolenaar009b2592004-10-24 19:18:58 +000062
Bram Moolenaarf37506f2016-08-31 22:22:10 +020063hi def link tppAbstractOptionKey Special
64hi def link tppPageLocalOptionKey Keyword
65hi def link tppPageLocalSwitchKey Keyword
66hi def link tppColorOptionKey Keyword
67hi def link tppTimeOptionKey Comment
68hi def link tppNewPageOptionKey PreProc
69hi def link tppString String
70hi def link tppColor String
71hi def link tppTime Number
72hi def link tppComment Comment
73hi def link tppAbstractOption Error
74hi def link tppPageLocalOption Error
75hi def link tppPageLocalSwitch Error
76hi def link tppColorOption Error
77hi def link tppNewPageOption Error
78hi def link tppTimeOption Error
Bram Moolenaar009b2592004-10-24 19:18:58 +000079
Bram Moolenaar009b2592004-10-24 19:18:58 +000080
Bram Moolenaar4c05fa02019-01-01 15:32:17 +010081let b:current_syntax = 'tpp'
Bram Moolenaar009b2592004-10-24 19:18:58 +000082
83" vim: ts=8 sw=2