tpp.vim 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. " Vim syntax file
  2. " Language: tpp - Text Presentation Program
  3. " Maintainer: Debian Vim Maintainers <pkg-vim-maintainers@lists.alioth.debian.org>
  4. " Former Maintainer: Gerfried Fuchs <alfie@ist.org>
  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
  7. " Filenames: *.tpp
  8. " License: BSD
  9. "
  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. "
  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. " quit when a syntax file was already loaded
  20. if exists("b:current_syntax")
  21. finish
  22. endif
  23. if !exists("main_syntax")
  24. let main_syntax = 'tpp'
  25. endif
  26. "" list of the legal switches/options
  27. syn match tppAbstractOptionKey contained "^--\%(author\|title\|date\|footer\) *" nextgroup=tppString
  28. syn match tppPageLocalOptionKey contained "^--\%(heading\|center\|right\|huge\|sethugefont\|exec\) *" nextgroup=tppString
  29. syn match tppPageLocalSwitchKey contained "^--\%(horline\|-\|\%(begin\|end\)\%(\%(shell\)\?output\|slide\%(left\|right\|top\|bottom\)\)\|\%(bold\|rev\|ul\)\%(on\|off\)\|withborder\)"
  30. syn match tppNewPageOptionKey contained "^--newpage *" nextgroup=tppString
  31. syn match tppColorOptionKey contained "^--\%(\%(bg\|fg\)\?color\) *"
  32. syn match tppTimeOptionKey contained "^--sleep *"
  33. syn match tppString contained ".*"
  34. syn match tppColor contained "\%(white\|yellow\|red\|green\|blue\|cyan\|magenta\|black\|default\)"
  35. syn match tppTime contained "\d\+"
  36. syn region tppPageLocalSwitch start="^--" end="$" contains=tppPageLocalSwitchKey oneline
  37. syn region tppColorOption start="^--\%(\%(bg\|fg\)\?color\)" end="$" contains=tppColorOptionKey,tppColor oneline
  38. syn region tppTimeOption start="^--sleep" end="$" contains=tppTimeOptionKey,tppTime oneline
  39. syn region tppNewPageOption start="^--newpage" end="$" contains=tppNewPageOptionKey oneline
  40. syn region tppPageLocalOption start="^--\%(heading\|center\|right\|huge\|sethugefont\|exec\)" end="$" contains=tppPageLocalOptionKey oneline
  41. syn region tppAbstractOption start="^--\%(author\|title\|date\|footer\)" end="$" contains=tppAbstractOptionKey oneline
  42. if main_syntax != 'sh'
  43. " shell command
  44. syn include @tppShExec syntax/sh.vim
  45. unlet b:current_syntax
  46. syn region shExec matchgroup=tppPageLocalOptionKey start='^--exec *' keepend end='$' contains=@tppShExec
  47. endif
  48. syn match tppComment "^--##.*$"
  49. " Define the default highlighting.
  50. " Only when an item doesn't have highlighting yet
  51. hi def link tppAbstractOptionKey Special
  52. hi def link tppPageLocalOptionKey Keyword
  53. hi def link tppPageLocalSwitchKey Keyword
  54. hi def link tppColorOptionKey Keyword
  55. hi def link tppTimeOptionKey Comment
  56. hi def link tppNewPageOptionKey PreProc
  57. hi def link tppString String
  58. hi def link tppColor String
  59. hi def link tppTime Number
  60. hi def link tppComment Comment
  61. hi def link tppAbstractOption Error
  62. hi def link tppPageLocalOption Error
  63. hi def link tppPageLocalSwitch Error
  64. hi def link tppColorOption Error
  65. hi def link tppNewPageOption Error
  66. hi def link tppTimeOption Error
  67. let b:current_syntax = "tpp"
  68. " vim: ts=8 sw=2