home *** CD-ROM | disk | FTP | other *** search
/ Chip 2000 February / OpenLinux 2.3 CD.iso / live / usr / share / vim / syntax / tf.vim < prev    next >
Encoding:
Text File  |  1999-08-10  |  6.9 KB  |  174 lines

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