home *** CD-ROM | disk | FTP | other *** search
/ vim.ftp.fu-berlin.de / 2015-02-03.vim.ftp.fu-berlin.de.tar / vim.ftp.fu-berlin.de / mac / vim55rt.sit / runtime / syntax / tf.vim < prev    next >
Encoding:
Text File  |  1999-09-25  |  7.0 KB  |  190 lines  |  [TEXT/VIM!]

  1. " Vim syntax file
  2. " Language:    tf
  3. " Maintainer:    Lutz Eymers <ixtab@polzin.com>
  4. " URL:        http://www-public.rz.uni-duesseldorf.de/~eymers/vim/syntax
  5. " Email:        send syntax_vim.tgz
  6. " Last change:    1999 Jun 14
  7. "
  8. " Options       tf_minlines = x     to sync at least x lines backwards
  9.  
  10. " Remove any old syntax stuff hanging around
  11. syn clear
  12. syn case match
  13.  
  14. if !exists("main_syntax")
  15.   let main_syntax = 'tf'
  16. endif
  17.  
  18. " Special global variables
  19. syn keyword tfVar  HOME LANG MAIL SHELL TERM TFHELP TFLIBDIR TFLIBRARY TZ  contained
  20. syn keyword tfVar  background backslash  contained
  21. syn keyword tfVar  bamf bg_output borg clearfull cleardone clock connect  contained
  22. syn keyword tfVar  emulation end_color gag gethostbyname gpri hook hilite  contained
  23. syn keyword tfVar  hiliteattr histsize hpri insert isize istrip kecho  contained
  24. syn keyword tfVar  kprefix login lp lpquote maildelay matching max_iter  contained
  25. syn keyword tfVar  max_recur mecho more mprefix oldslash promt_sec  contained
  26. syn keyword tfVar  prompt_usec proxy_host proxy_port ptime qecho qprefix  contained
  27. syn keyword tfVar  quite quitdone redef refreshtime scroll shpause snarf sockmload  contained
  28. syn keyword tfVar  start_color tabsize telopt sub time_format visual  contained
  29. syn keyword tfVar  watch_dog watchname wordpunct wrap wraplog wrapsize  contained
  30. syn keyword tfVar  wrapspace  contained
  31.  
  32. " Worldvar
  33. syn keyword tfWorld  world_name world_character world_password world_host contained
  34. syn keyword tfWorld  world_port world_mfile world_type contained
  35.  
  36. " Number
  37. syn match tfNumber  "-\=\<\d\+\>"
  38.  
  39. " Float
  40. syn match tfFloat  "\(-\=\<\d+\|-\=\)\.\d\+\>"
  41.  
  42. " Operator
  43. syn match tfOperator  "[-+=?:&|!]"
  44. syn match tfOperator  "/[^*~@]"he=e-1
  45. syn match tfOperator  ":="
  46. syn match tfOperator  "[^/%]\*"hs=s+1
  47. syn match tfOperator  "$\+[([{]"he=e-1,me=e-1
  48. syn match tfOperator  "\^\[\+"he=s+1 contains=tfSpecialCharEsc
  49.  
  50. " Relational
  51. syn match tfRelation  "&&"
  52. syn match tfRelation  "||"
  53. syn match tfRelation  "[<>/!=]="
  54. syn match tfRelation  "[<>]"
  55. syn match tfRelation  "[!=]\~"
  56. syn match tfRelation  "[=!]/"
  57.  
  58.  
  59. " Readonly Var
  60. syn match tfReadonly  "[#*]" contained
  61. syn match tfReadonly  "\<-\=L\=\d\{-}\>" contained
  62. syn match tfReadonly  "\<P\(\d\+\|R\|L\)\>" contained
  63. syn match tfReadonly  "\<R\>" contained
  64.  
  65. " Identifier
  66. syn match tfIdentifier "%\+[a-zA-Z_#*-0-9][a-zA-Z0-9_]*" contains=tfVar,tfReadonly
  67. syn match tfIdentifier "%\+[{]"he=e-1,me=e-1
  68. syn match tfIdentifier "\$\+{[a-zA-Z_#*-0-9][a-zA-Z0-9_]*}" contains=tfWorld
  69.  
  70. " Function names
  71. syn keyword tfFunctions  ascii char columns echo filename ftime fwrite getopts
  72. syn keyword tfFunctions  getpid idle kbdel kbgoto kbhead kblen kbmatch kbpoint
  73. syn keyword tfFunctions  kbtail kbwordleft kbwordright keycode lines mod
  74. syn keyword tfFunctions  moresize pad rand read regmatch send strcat strchr
  75. syn keyword tfFunctions  strcmp strlen strncmp strrchr strrep strstr substr
  76. syn keyword tfFunctions  systype time tolower toupper
  77.  
  78. syn keyword tfStatement  addworld bamf beep bind break cat changes connect  contained
  79. syn keyword tfStatement  dc def dokey echo edit escape eval export expr fg for  contained
  80. syn keyword tfStatement  gag getfile grab help hilite histsize hook if input  contained
  81. syn keyword tfStatement  kill lcd let list listsockets listworlds load  contained
  82. syn keyword tfStatement  localecho log nohilite not partial paste ps purge  contained
  83. syn keyword tfStatement  purgeworld putfile quit quote recall recordline save  contained
  84. syn keyword tfStatement  saveworld send sh shift sub substitute  contained
  85. syn keyword tfStatement  suspend telnet test time toggle trig trigger unbind  contained
  86. syn keyword tfStatement  undef undefn undeft unhook  untrig unworld  contained
  87. syn keyword tfStatement  version watchdog watchname while world  contained
  88.  
  89. " Hooks
  90. syn keyword tfHook  ACTIVITY BACKGROUND BAMF CONFAIL CONFLICT CONNECT DISCONNECT
  91. syn keyword tfHook  KILL LOAD LOADFAIL LOG LOGIN MAIL MORE PENDING PENDING
  92. syn keyword tfHook  PROCESS PROMPT PROXY REDEF RESIZE RESUME SEND SHADOW SHELL
  93. syn keyword tfHook  SIGHUP SIGTERM SIGUSR1 SIGUSR2 WORLD
  94.  
  95. " Conditional
  96. syn keyword tfConditional  if endif then else elseif  contained
  97.  
  98. " Repeat
  99. syn keyword tfRepeat  while do done repeat for  contained
  100.  
  101. " Statement
  102. syn keyword tfStatement  break quit contained
  103.  
  104. " Include
  105. syn keyword  tfInclude require load save loaded contained
  106.  
  107. " Define
  108. syn keyword  tfDefine bind unbind def undef undefn undefn purge hook unhook trig untrig  contained
  109. syn keyword  tfDefine set unset setenv  contained
  110.  
  111. " Todo
  112. syn keyword  tfTodo TODO Todo todo  contained
  113.  
  114. " SpecialChar
  115. syn match tfSpecialChar "\\[abcfnrtyv\\]" contained
  116. syn match tfSpecialChar "\\\d\{3}" contained contains=tfOctalError
  117. syn match tfSpecialChar "\\x[0-9a-fA-F]\{2}" contained
  118. syn match tfSpecialCharEsc "\[\+" contained
  119.  
  120. syn match tfOctalError "[89]" contained
  121.  
  122. " Comment
  123. syn region tfComment        start="^;" end="$"  contains=tfTodo
  124.  
  125. " String
  126. syn region tfString   oneline matchgroup=None start=+'+  skip=+\\\\\|\\'+  end=+'+ contains=tfIdentifier,tfSpecialChar,tfEscape
  127. syn region tfString   matchgroup=None start=+"+  skip=+\\\\\|\\"+  end=+"+ contains=tfIdentifier,tfSpecialChar,tfEscape
  128.  
  129. syn match tfParentError "[)}\]]"
  130.  
  131. " Parents
  132. syn region tfParent matchgroup=Delimiter start="(" end=")" contains=ALLBUT,tfReadonly
  133. syn region tfParent matchgroup=Delimiter start="\[" end="\]" contains=ALL
  134. syn region tfParent matchgroup=Delimiter start="{" end="}" contains=ALL
  135.  
  136. syn match tfEndCommand "%%\{-};"
  137. syn match tfJoinLines "\\$"
  138.  
  139. " Types
  140.  
  141. syn match tfType "/[a-zA-Z_~@][a-zA-Z0-9_]*" contains=tfConditional,tfRepeat,tfStatement,tfInclude,tfDefine,tfStatement
  142.  
  143. " Catch /quote .. '
  144. syn match tfQuotes "/quote .\{-}'" contains=ALLBUT,tfString
  145. " Catch $(/escape   )
  146. syn match tfEscape "(/escape .*)"
  147.  
  148. " sync
  149. if exists("tf_minlines")
  150.   exec "syn sync minlines=" . tf_minlines
  151. endif
  152.  
  153. if !exists("did_tf_syntax_inits")
  154.   let did_tf_syntax_inits = 1
  155.   " The default methods for highlighting.  Can be overridden later
  156.   hi link tfComment                   Comment
  157.   hi link tfString                    String
  158.   hi link tfNumber                    Number
  159.   hi link tfFloat                     Float
  160.   hi tfIdentifier guifg=DarkGray ctermfg=Brown
  161.   hi link tfFunctions                 Function
  162.   hi link tfRepeat                    Repeat
  163.   hi link tfConditional               Conditional
  164.   hi link tfLabel                     Label
  165.   hi link tfStatement                 Statement
  166.   hi link tfType                      Type
  167.   hi link tfInclude                   Include
  168.   hi link tfDefine                    Define
  169.   hi link tfSpecialChar               SpecialChar
  170.   hi link tfSpecialCharEsc            SpecialChar
  171.   hi link tfParentError                  Error
  172.   hi link tfTodo                      Todo
  173.   hi link tfEndCommand              Delimiter
  174.   hi link tfJoinLines              Delimiter
  175.   hi tfRelation guifg=SeaGreen ctermfg=DarkGreen
  176.   hi tfOperator guifg=SeaGreen ctermfg=DarkGreen
  177.   hi tfVar guifg=Red ctermfg=DarkRed
  178.   hi tfWorld guifg=Red ctermfg=DarkRed
  179.   hi tfReadonly guifg=Red ctermfg=DarkRed
  180.   hi tfHook guifg=Red ctermfg=DarkRed
  181. endif
  182.  
  183. let b:current_syntax = "tf"
  184.  
  185. if main_syntax == 'tf'
  186.   unlet main_syntax
  187. endif
  188.  
  189. " vim: ts=8
  190.