Bram Moolenaar | 009b259 | 2004-10-24 19:18:58 +0000 | [diff] [blame] | 1 | " Vim syntax file |
Bram Moolenaar | 4c05fa0 | 2019-01-01 15:32:17 +0100 | [diff] [blame] | 2 | " Language: tpp - Text Presentation Program |
| 3 | " Maintainer: Debian Vim Maintainers |
| 4 | " Former Maintainer: Gerfried Fuchs <alfie@ist.org> |
| 5 | " Last Change: 2018 Dec 27 |
| 6 | " URL: https://salsa.debian.org/vim-team/vim-debian/master/syntax/tpp.vim |
| 7 | " Filenames: *.tpp |
| 8 | " License: BSD |
Bram Moolenaar | 009b259 | 2004-10-24 19:18:58 +0000 | [diff] [blame] | 9 | " |
Bram Moolenaar | a93fa7e | 2006-04-17 22:14:47 +0000 | [diff] [blame] | 10 | " 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 Moolenaar | 009b259 | 2004-10-24 19:18:58 +0000 | [diff] [blame] | 16 | " 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 Moolenaar | 89bcfda | 2016-08-30 23:26:57 +0200 | [diff] [blame] | 20 | " quit when a syntax file was already loaded |
Bram Moolenaar | 4c05fa0 | 2019-01-01 15:32:17 +0100 | [diff] [blame] | 21 | if exists('b:current_syntax') |
Bram Moolenaar | 009b259 | 2004-10-24 19:18:58 +0000 | [diff] [blame] | 22 | finish |
| 23 | endif |
| 24 | |
Bram Moolenaar | 4c05fa0 | 2019-01-01 15:32:17 +0100 | [diff] [blame] | 25 | if !exists('main_syntax') |
Bram Moolenaar | 009b259 | 2004-10-24 19:18:58 +0000 | [diff] [blame] | 26 | let main_syntax = 'tpp' |
| 27 | endif |
| 28 | |
| 29 | |
| 30 | "" list of the legal switches/options |
Bram Moolenaar | a93fa7e | 2006-04-17 22:14:47 +0000 | [diff] [blame] | 31 | syn match tppAbstractOptionKey contained "^--\%(author\|title\|date\|footer\) *" nextgroup=tppString |
| 32 | syn match tppPageLocalOptionKey contained "^--\%(heading\|center\|right\|huge\|sethugefont\|exec\) *" nextgroup=tppString |
Bram Moolenaar | 009b259 | 2004-10-24 19:18:58 +0000 | [diff] [blame] | 33 | syn match tppPageLocalSwitchKey contained "^--\%(horline\|-\|\%(begin\|end\)\%(\%(shell\)\?output\|slide\%(left\|right\|top\|bottom\)\)\|\%(bold\|rev\|ul\)\%(on\|off\)\|withborder\)" |
Bram Moolenaar | a93fa7e | 2006-04-17 22:14:47 +0000 | [diff] [blame] | 34 | syn match tppNewPageOptionKey contained "^--newpage *" nextgroup=tppString |
Bram Moolenaar | 009b259 | 2004-10-24 19:18:58 +0000 | [diff] [blame] | 35 | syn match tppColorOptionKey contained "^--\%(\%(bg\|fg\)\?color\) *" |
| 36 | syn match tppTimeOptionKey contained "^--sleep *" |
| 37 | |
Bram Moolenaar | a93fa7e | 2006-04-17 22:14:47 +0000 | [diff] [blame] | 38 | syn match tppString contained ".*" |
| 39 | syn match tppColor contained "\%(white\|yellow\|red\|green\|blue\|cyan\|magenta\|black\|default\)" |
Bram Moolenaar | 009b259 | 2004-10-24 19:18:58 +0000 | [diff] [blame] | 40 | syn match tppTime contained "\d\+" |
| 41 | |
| 42 | syn region tppPageLocalSwitch start="^--" end="$" contains=tppPageLocalSwitchKey oneline |
| 43 | syn region tppColorOption start="^--\%(\%(bg\|fg\)\?color\)" end="$" contains=tppColorOptionKey,tppColor oneline |
| 44 | syn region tppTimeOption start="^--sleep" end="$" contains=tppTimeOptionKey,tppTime oneline |
| 45 | syn region tppNewPageOption start="^--newpage" end="$" contains=tppNewPageOptionKey oneline |
Bram Moolenaar | 293ee4d | 2004-12-09 21:34:53 +0000 | [diff] [blame] | 46 | syn region tppPageLocalOption start="^--\%(heading\|center\|right\|huge\|sethugefont\|exec\)" end="$" contains=tppPageLocalOptionKey oneline |
Bram Moolenaar | a93fa7e | 2006-04-17 22:14:47 +0000 | [diff] [blame] | 47 | syn region tppAbstractOption start="^--\%(author\|title\|date\|footer\)" end="$" contains=tppAbstractOptionKey oneline |
Bram Moolenaar | 009b259 | 2004-10-24 19:18:58 +0000 | [diff] [blame] | 48 | |
Bram Moolenaar | 4c05fa0 | 2019-01-01 15:32:17 +0100 | [diff] [blame] | 49 | if main_syntax !=# 'sh' |
Bram Moolenaar | 009b259 | 2004-10-24 19:18:58 +0000 | [diff] [blame] | 50 | " shell command |
Bram Moolenaar | 89bcfda | 2016-08-30 23:26:57 +0200 | [diff] [blame] | 51 | syn include @tppShExec syntax/sh.vim |
Bram Moolenaar | 009b259 | 2004-10-24 19:18:58 +0000 | [diff] [blame] | 52 | unlet b:current_syntax |
| 53 | |
| 54 | syn region shExec matchgroup=tppPageLocalOptionKey start='^--exec *' keepend end='$' contains=@tppShExec |
| 55 | |
| 56 | endif |
| 57 | |
Bram Moolenaar | 293ee4d | 2004-12-09 21:34:53 +0000 | [diff] [blame] | 58 | syn match tppComment "^--##.*$" |
Bram Moolenaar | 009b259 | 2004-10-24 19:18:58 +0000 | [diff] [blame] | 59 | |
| 60 | " Define the default highlighting. |
Bram Moolenaar | 89bcfda | 2016-08-30 23:26:57 +0200 | [diff] [blame] | 61 | " Only when an item doesn't have highlighting yet |
Bram Moolenaar | 009b259 | 2004-10-24 19:18:58 +0000 | [diff] [blame] | 62 | |
Bram Moolenaar | f37506f | 2016-08-31 22:22:10 +0200 | [diff] [blame] | 63 | hi def link tppAbstractOptionKey Special |
| 64 | hi def link tppPageLocalOptionKey Keyword |
| 65 | hi def link tppPageLocalSwitchKey Keyword |
| 66 | hi def link tppColorOptionKey Keyword |
| 67 | hi def link tppTimeOptionKey Comment |
| 68 | hi def link tppNewPageOptionKey PreProc |
| 69 | hi def link tppString String |
| 70 | hi def link tppColor String |
| 71 | hi def link tppTime Number |
| 72 | hi def link tppComment Comment |
| 73 | hi def link tppAbstractOption Error |
| 74 | hi def link tppPageLocalOption Error |
| 75 | hi def link tppPageLocalSwitch Error |
| 76 | hi def link tppColorOption Error |
| 77 | hi def link tppNewPageOption Error |
| 78 | hi def link tppTimeOption Error |
Bram Moolenaar | 009b259 | 2004-10-24 19:18:58 +0000 | [diff] [blame] | 79 | |
Bram Moolenaar | 009b259 | 2004-10-24 19:18:58 +0000 | [diff] [blame] | 80 | |
Bram Moolenaar | 4c05fa0 | 2019-01-01 15:32:17 +0100 | [diff] [blame] | 81 | let b:current_syntax = 'tpp' |
Bram Moolenaar | 009b259 | 2004-10-24 19:18:58 +0000 | [diff] [blame] | 82 | |
| 83 | " vim: ts=8 sw=2 |