Bram Moolenaar | 009b259 | 2004-10-24 19:18:58 +0000 | [diff] [blame] | 1 | " Vim syntax file |
| 2 | " Language: tpp - Text Presentation Program |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 3 | " Maintainer: Debian Vim Maintainers <pkg-vim-maintainers@lists.alioth.debian.org> |
Bram Moolenaar | a93fa7e | 2006-04-17 22:14:47 +0000 | [diff] [blame] | 4 | " Former Maintainer: Gerfried Fuchs <alfie@ist.org> |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 5 | " Last Change: 2007-10-14 |
| 6 | " URL: http://git.debian.org/?p=pkg-vim/vim.git;a=blob_plain;f=runtime/syntax/tpp.vim;hb=debian |
Bram Moolenaar | 009b259 | 2004-10-24 19:18:58 +0000 | [diff] [blame] | 7 | " Filenames: *.tpp |
Bram Moolenaar | 009b259 | 2004-10-24 19:18:58 +0000 | [diff] [blame] | 8 | " License: BSD |
| 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 | |
| 20 | " For version 5.x: Clear all syntax items |
| 21 | " For version 6.x: Quit when a syntax file was already loaded |
| 22 | if version < 600 |
| 23 | syntax clear |
| 24 | elseif exists("b:current_syntax") |
| 25 | finish |
| 26 | endif |
| 27 | |
| 28 | if !exists("main_syntax") |
| 29 | let main_syntax = 'tpp' |
| 30 | endif |
| 31 | |
| 32 | |
| 33 | "" list of the legal switches/options |
Bram Moolenaar | a93fa7e | 2006-04-17 22:14:47 +0000 | [diff] [blame] | 34 | syn match tppAbstractOptionKey contained "^--\%(author\|title\|date\|footer\) *" nextgroup=tppString |
| 35 | syn match tppPageLocalOptionKey contained "^--\%(heading\|center\|right\|huge\|sethugefont\|exec\) *" nextgroup=tppString |
Bram Moolenaar | 009b259 | 2004-10-24 19:18:58 +0000 | [diff] [blame] | 36 | 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] | 37 | syn match tppNewPageOptionKey contained "^--newpage *" nextgroup=tppString |
Bram Moolenaar | 009b259 | 2004-10-24 19:18:58 +0000 | [diff] [blame] | 38 | syn match tppColorOptionKey contained "^--\%(\%(bg\|fg\)\?color\) *" |
| 39 | syn match tppTimeOptionKey contained "^--sleep *" |
| 40 | |
Bram Moolenaar | a93fa7e | 2006-04-17 22:14:47 +0000 | [diff] [blame] | 41 | syn match tppString contained ".*" |
| 42 | 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] | 43 | syn match tppTime contained "\d\+" |
| 44 | |
| 45 | syn region tppPageLocalSwitch start="^--" end="$" contains=tppPageLocalSwitchKey oneline |
| 46 | syn region tppColorOption start="^--\%(\%(bg\|fg\)\?color\)" end="$" contains=tppColorOptionKey,tppColor oneline |
| 47 | syn region tppTimeOption start="^--sleep" end="$" contains=tppTimeOptionKey,tppTime oneline |
| 48 | syn region tppNewPageOption start="^--newpage" end="$" contains=tppNewPageOptionKey oneline |
Bram Moolenaar | 293ee4d | 2004-12-09 21:34:53 +0000 | [diff] [blame] | 49 | 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] | 50 | syn region tppAbstractOption start="^--\%(author\|title\|date\|footer\)" end="$" contains=tppAbstractOptionKey oneline |
Bram Moolenaar | 009b259 | 2004-10-24 19:18:58 +0000 | [diff] [blame] | 51 | |
| 52 | if main_syntax != 'sh' |
| 53 | " shell command |
| 54 | if version < 600 |
| 55 | syn include @tppShExec <sfile>:p:h/sh.vim |
| 56 | else |
| 57 | syn include @tppShExec syntax/sh.vim |
| 58 | endif |
| 59 | unlet b:current_syntax |
| 60 | |
| 61 | syn region shExec matchgroup=tppPageLocalOptionKey start='^--exec *' keepend end='$' contains=@tppShExec |
| 62 | |
| 63 | endif |
| 64 | |
Bram Moolenaar | 293ee4d | 2004-12-09 21:34:53 +0000 | [diff] [blame] | 65 | syn match tppComment "^--##.*$" |
Bram Moolenaar | 009b259 | 2004-10-24 19:18:58 +0000 | [diff] [blame] | 66 | |
| 67 | " Define the default highlighting. |
| 68 | " For version 5.7 and earlier: only when not done already |
| 69 | " For version 5.8 and later: only when an item doesn't have highlighting yet |
| 70 | if version >= 508 || !exists("did_tpp_syn_inits") |
| 71 | if version < 508 |
| 72 | let did_tpp_syn_inits = 1 |
| 73 | command -nargs=+ HiLink hi link <args> |
| 74 | else |
| 75 | command -nargs=+ HiLink hi def link <args> |
| 76 | endif |
| 77 | |
| 78 | HiLink tppAbstractOptionKey Special |
| 79 | HiLink tppPageLocalOptionKey Keyword |
| 80 | HiLink tppPageLocalSwitchKey Keyword |
| 81 | HiLink tppColorOptionKey Keyword |
| 82 | HiLink tppTimeOptionKey Comment |
| 83 | HiLink tppNewPageOptionKey PreProc |
Bram Moolenaar | a93fa7e | 2006-04-17 22:14:47 +0000 | [diff] [blame] | 84 | HiLink tppString String |
Bram Moolenaar | 009b259 | 2004-10-24 19:18:58 +0000 | [diff] [blame] | 85 | HiLink tppColor String |
| 86 | HiLink tppTime Number |
Bram Moolenaar | 293ee4d | 2004-12-09 21:34:53 +0000 | [diff] [blame] | 87 | HiLink tppComment Comment |
Bram Moolenaar | 009b259 | 2004-10-24 19:18:58 +0000 | [diff] [blame] | 88 | HiLink tppAbstractOption Error |
| 89 | HiLink tppPageLocalOption Error |
| 90 | HiLink tppPageLocalSwitch Error |
| 91 | HiLink tppColorOption Error |
| 92 | HiLink tppNewPageOption Error |
| 93 | HiLink tppTimeOption Error |
| 94 | |
| 95 | delcommand HiLink |
| 96 | endif |
| 97 | |
| 98 | let b:current_syntax = "tpp" |
| 99 | |
| 100 | " vim: ts=8 sw=2 |