0
0
mirror of https://github.com/vim/vim.git synced 2025-07-04 23:07:33 -04:00
vim/runtime/syntax/tpp.vim

101 lines
3.8 KiB
VimL
Raw Normal View History

2004-10-24 19:18:58 +00:00
" Vim syntax file
" Language: tpp - Text Presentation Program
2008-06-24 21:56:24 +00:00
" Maintainer: Debian Vim Maintainers <pkg-vim-maintainers@lists.alioth.debian.org>
2006-04-17 22:14:47 +00:00
" Former Maintainer: Gerfried Fuchs <alfie@ist.org>
2008-06-24 21:56:24 +00:00
" Last Change: 2007-10-14
" URL: http://git.debian.org/?p=pkg-vim/vim.git;a=blob_plain;f=runtime/syntax/tpp.vim;hb=debian
2004-10-24 19:18:58 +00:00
" Filenames: *.tpp
" License: BSD
"
2006-04-17 22:14:47 +00:00
" XXX This file is in need of a new maintainer, Debian VIM Maintainers maintain
" it only because patches have been submitted for it by Debian users and the
" former maintainer was MIA (Missing In Action), taking over its
" maintenance was thus the only way to include those patches.
" If you care about this file, and have time to maintain it please do so!
"
2004-10-24 19:18:58 +00:00
" Comments are very welcome - but please make sure that you are commenting on
" the latest version of this file.
" SPAM is _NOT_ welcome - be ready to be reported!
" For version 5.x: Clear all syntax items
" For version 6.x: Quit when a syntax file was already loaded
if version < 600
syntax clear
elseif exists("b:current_syntax")
finish
endif
if !exists("main_syntax")
let main_syntax = 'tpp'
endif
"" list of the legal switches/options
2006-04-17 22:14:47 +00:00
syn match tppAbstractOptionKey contained "^--\%(author\|title\|date\|footer\) *" nextgroup=tppString
syn match tppPageLocalOptionKey contained "^--\%(heading\|center\|right\|huge\|sethugefont\|exec\) *" nextgroup=tppString
2004-10-24 19:18:58 +00:00
syn match tppPageLocalSwitchKey contained "^--\%(horline\|-\|\%(begin\|end\)\%(\%(shell\)\?output\|slide\%(left\|right\|top\|bottom\)\)\|\%(bold\|rev\|ul\)\%(on\|off\)\|withborder\)"
2006-04-17 22:14:47 +00:00
syn match tppNewPageOptionKey contained "^--newpage *" nextgroup=tppString
2004-10-24 19:18:58 +00:00
syn match tppColorOptionKey contained "^--\%(\%(bg\|fg\)\?color\) *"
syn match tppTimeOptionKey contained "^--sleep *"
2006-04-17 22:14:47 +00:00
syn match tppString contained ".*"
syn match tppColor contained "\%(white\|yellow\|red\|green\|blue\|cyan\|magenta\|black\|default\)"
2004-10-24 19:18:58 +00:00
syn match tppTime contained "\d\+"
syn region tppPageLocalSwitch start="^--" end="$" contains=tppPageLocalSwitchKey oneline
syn region tppColorOption start="^--\%(\%(bg\|fg\)\?color\)" end="$" contains=tppColorOptionKey,tppColor oneline
syn region tppTimeOption start="^--sleep" end="$" contains=tppTimeOptionKey,tppTime oneline
syn region tppNewPageOption start="^--newpage" end="$" contains=tppNewPageOptionKey oneline
2004-12-09 21:34:53 +00:00
syn region tppPageLocalOption start="^--\%(heading\|center\|right\|huge\|sethugefont\|exec\)" end="$" contains=tppPageLocalOptionKey oneline
2006-04-17 22:14:47 +00:00
syn region tppAbstractOption start="^--\%(author\|title\|date\|footer\)" end="$" contains=tppAbstractOptionKey oneline
2004-10-24 19:18:58 +00:00
if main_syntax != 'sh'
" shell command
if version < 600
syn include @tppShExec <sfile>:p:h/sh.vim
else
syn include @tppShExec syntax/sh.vim
endif
unlet b:current_syntax
syn region shExec matchgroup=tppPageLocalOptionKey start='^--exec *' keepend end='$' contains=@tppShExec
endif
2004-12-09 21:34:53 +00:00
syn match tppComment "^--##.*$"
2004-10-24 19:18:58 +00:00
" Define the default highlighting.
" For version 5.7 and earlier: only when not done already
" For version 5.8 and later: only when an item doesn't have highlighting yet
if version >= 508 || !exists("did_tpp_syn_inits")
if version < 508
let did_tpp_syn_inits = 1
command -nargs=+ HiLink hi link <args>
else
command -nargs=+ HiLink hi def link <args>
endif
HiLink tppAbstractOptionKey Special
HiLink tppPageLocalOptionKey Keyword
HiLink tppPageLocalSwitchKey Keyword
HiLink tppColorOptionKey Keyword
HiLink tppTimeOptionKey Comment
HiLink tppNewPageOptionKey PreProc
2006-04-17 22:14:47 +00:00
HiLink tppString String
2004-10-24 19:18:58 +00:00
HiLink tppColor String
HiLink tppTime Number
2004-12-09 21:34:53 +00:00
HiLink tppComment Comment
2004-10-24 19:18:58 +00:00
HiLink tppAbstractOption Error
HiLink tppPageLocalOption Error
HiLink tppPageLocalSwitch Error
HiLink tppColorOption Error
HiLink tppNewPageOption Error
HiLink tppTimeOption Error
delcommand HiLink
endif
let b:current_syntax = "tpp"
" vim: ts=8 sw=2