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

  1. " Vim syntax file
  2. " Language:    phtml PHP 2.0
  3. " Maintainer:    Lutz Eymers <ixtab@polzin.com>
  4. " URL:        http://www-public.rz.uni-duesseldorf.de/~eymers/stuff/syntax_vim.tgz
  5. " Email:        Subject: send syntax_vim.tgz
  6. " Last change:    1998 May 8
  7.  
  8. " Remove any old syntax stuff hanging around
  9. syn clear
  10.  
  11. so $VIM/syntax/html.vim
  12. syn clear htmlTag
  13. syn clear javaScript
  14. syn region  htmlTag                start=+<[^/]+ end=+>+              contains=htmlString,htmlTagName,htmlArg,htmlValue,htmlTagError,htmlEvent,phtmlRegion 
  15. syn region  javaScript                           start=+<script+ end=+</script>+ contains=javaScriptSpecial,javaScriptNumber,javaScriptLineComment,javaScriptComment,javaScriptStringS,javaScriptStringD,javaStringCharacter,javaStringSpecialCharacter,javaScriptConditional,javaScriptRepeat,javaScriptBranch,javaScriptOperator,javaScriptType,javaScriptStatement,javaScriptFunction,javaScriptBoolean,javaScriptBraces,javaScriptParen,javaScriptParenError,phtmlRegion
  16.  
  17. syn case match
  18.  
  19. " Env Variables
  20. syn keyword phtmlEnvVar SERVER_SOFTWARE SERVER_NAME SERVER_URL GATEWAY_INTERFACE   contained
  21. syn keyword phtmlEnvVar SERVER_PROTOCOL SERVER_PORT REQUEST_METHOD PATH_INFO  contained
  22. syn keyword phtmlEnvVar PATH_TRANSLATED SCRIPT_NAME QUERY_STRING REMOTE_HOST contained
  23. syn keyword phtmlEnvVar REMOTE_ADDR AUTH_TYPE REMOTE_USER CONTEN_TYPE  contained
  24. syn keyword phtmlEnvVar CONTENT_LENGTH HTTPS HTTPS_KEYSIZE HTTPS_SECRETKEYSIZE  contained
  25. syn keyword phtmlEnvVar HTTP_ACCECT HTTP_USER_AGENT HTTP_IF_MODIFIED_SINCE  contained
  26. syn keyword phtmlEnvVar HTTP_FROM  contained
  27.  
  28. syn case ignore
  29.  
  30. " Internal Variables
  31. syn keyword phtmlIntVar phperrmsg php_self contained
  32.  
  33. " Comment
  34. syn region phtmlComment        start="/\*" skip=">" end="\*/"  contained contains=phtmlTodo
  35.  
  36. " Function names
  37. syn keyword phtmlFunctions  Abs Ada_Close Ada_Connect Ada_Exec Ada_FetchRow contained
  38. syn keyword phtmlFunctions  Ada_FieldName Ada_FieldNum Ada_FieldType contained
  39. syn keyword phtmlFunctions  Ada_FreeResult Ada_NumFields Ada_NumRows Ada_Result contained
  40. syn keyword phtmlFunctions  Ada_ResultAll AddSlashes ASort BinDec Ceil ChDir contained
  41. syn keyword phtmlFunctions  AdaGrp ChMod ChOwn Chop Chr ClearStack ClearStatCache contained
  42. syn keyword phtmlFunctions  closeDir CloseLog Cos Count Crypt Date dbList  contained
  43. syn keyword phtmlFunctions  dbmClose dbmDelete dbmExists dbmFetch dbmFirstKey contained
  44. syn keyword phtmlFunctions  dbmInsert dbmNextKey dbmOpen dbmReplace DecBin DecHex contained
  45. syn keyword phtmlFunctions  DecOct doubleval Echo End ereg eregi ereg_replace contained
  46. syn keyword phtmlFunctions  eregi_replace EscapeShellCmd Eval Exec Exit Exp contained
  47. syn keyword phtmlFunctions  fclose feof fgets fgetss File fileAtime fileCtime contained
  48. syn keyword phtmlFunctions  fileGroup fileInode fileMtime fileOwner filePerms contained
  49. syn keyword phtmlFunctions  fileSize fileType Floor Flush fopen fputs FPassThru contained
  50. syn keyword phtmlFunctions  fseek fsockopen ftell getAccDir GetEnv getHostByName contained
  51. syn keyword phtmlFunctions  getHostByAddr GetImageSize getLastAcess contained
  52. syn keyword phtmlFunctions  getLastbrowser getLastEmail getLastHost getLastMod contained
  53. syn keyword phtmlFunctions  getLastref getLogDir getMyInode getMyPid getMyUid contained
  54. syn keyword phtmlFunctions  getRandMax getStartLogging getToday getTotal GetType contained
  55. syn keyword phtmlFunctions  gmDate Header HexDec HtmlSpecialChars ImageArc contained
  56. syn keyword phtmlFunctions  ImageChar ImageCharUp IamgeColorAllocate  contained
  57. syn keyword phtmlFunctions  ImageColorTransparent ImageCopyResized ImageCreate contained
  58. syn keyword phtmlFunctions  ImageCreateFromGif ImageDestroy ImageFill contained
  59. syn keyword phtmlFunctions  ImageFilledPolygon ImageFilledRectangle contained
  60. syn keyword phtmlFunctions  ImageFillToBorder ImageGif ImageInterlace ImageLine contained
  61. syn keyword phtmlFunctions  ImagePolygon ImageRectangle ImageSetPixel  contained
  62. syn keyword phtmlFunctions  ImageString ImageStringUp ImageSX ImageSY Include contained
  63. syn keyword phtmlFunctions  InitSyslog intval IsSet Key Link LinkInfo Log Log10 contained
  64. syn keyword phtmlFunctions  LosAs Mail Max Md5 mi_Close mi_Connect mi_DBname contained
  65. syn keyword phtmlFunctions  mi_Exec mi_FieldName mi_FieldNum mi_NumFields contained
  66. syn keyword phtmlFunctions  mi_NumRows mi_Result Microtime Min MkDir MkTime msql contained
  67. syn keyword phtmlFunctions  msql_connect msql_CreateDB msql_dbName msql_DropDB contained
  68. syn keyword phtmlFunctions  msqlFieldFlags msql_FieldLen msql_FieldName contained
  69. syn keyword phtmlFunctions  msql_FieldType msql_FreeResult msql_ListDBs contained
  70. syn keyword phtmlFunctions  msql_Listfields msql_ListTables msql_NumFields contained
  71. syn keyword phtmlFunctions  msql_NumRows msql_RegCase msql_Result msql_TableName contained
  72. syn keyword phtmlFunctions  mysql mysql_affected_rows mysql_close mysql_connect contained
  73. syn keyword phtmlFunctions  mysql_CreateDB mysql_dbName mysqlDropDB  contained
  74. syn keyword phtmlFunctions  mysql_FieldFlags mysql_FieldLen mysql_FieldName contained
  75. syn keyword phtmlFunctions  mysql_FieldType mysql_FreeResult mysql_insert_id contained
  76. syn keyword phtmlFunctions  mysql_listDBs mysql_Listfields mysql_ListTables contained
  77. syn keyword phtmlFunctions  mysql_NumFields mysql_NumRows mysql_Result  contained
  78. syn keyword phtmlFunctions  mysql_TableName Next OctDec openDir OpenLog  contained
  79. syn keyword phtmlFunctions  Ora_Bind Ora_Close Ora_Commit Ora_CommitOff contained
  80. syn keyword phtmlFunctions  Ora_CommitOn Ora_Exec Ora_Fetch Ora_GetColumn contained
  81. syn keyword phtmlFunctions  Ora_Logoff Ora_Logon Ora_Parse Ora_Rollback Ord  contained
  82. syn keyword phtmlFunctions  Parse_str PassThru pclose pg_Close pg_Connect contained
  83. syn keyword phtmlFunctions  pg_DBname pg_ErrorMessage pg_Exec pg_FieldName contained
  84. syn keyword phtmlFunctions  pg_FieldPrtLen pg_FieldNum pg_FieldSize  contained
  85. syn keyword phtmlFunctions  pg_FieldType pg_FreeResult pg_GetLastOid pg_Host contained
  86. syn keyword phtmlFunctions  pg_NumFields pg_NumRows pg_Options pg_Port  contained
  87. syn keyword phtmlFunctions  pg_Result pg_tty phpInfo phpVersion popen pos pow contained
  88. syn keyword phtmlFunctions  Prev PutEnv QuoteMeta Rand readDir ReadFile ReadLink contained
  89. syn keyword phtmlFunctions  reg_Match reg_replace reg_Search Rename Reset return  contained
  90. syn keyword phtmlFunctions  rewind rewindDir RmDir SetCookie SetErrorReporting contained
  91. syn keyword phtmlFunctions  SetLogging SetShowInfo SetType shl shr Sin Sleep contained
  92. syn keyword phtmlFunctions  Solid_Close Solid_Connect Solid_Exec Solid_FetchRow contained
  93. syn keyword phtmlFunctions  Solid_FieldName Solid_FieldNum Solid_FreeResult  contained
  94. syn keyword phtmlFunctions  Solid_NumFields Solid_NumRows Solid_Result Sort contained
  95. syn keyword phtmlFunctions  Spundtex Sprintf Sqrt Srand strchr strtr  contained
  96. syn keyword phtmlFunctions  StripSlashes strlen strchr strstr strtok strtolower contained
  97. syn keyword phtmlFunctions  strtoupper strval substr sybSQL_CheckConnect contained
  98. syn keyword phtmlFunctions  sybSQL_DBUSE sybSQL_Connect sybSQL_Exit contained
  99. syn keyword phtmlFunctions  sybSQL_Fieldname sybSQL_GetField sybSQL_IsRow  contained
  100. syn keyword phtmlFunctions  sybSQL_NextRow sybSQL_NumFields sybSQL_NumRows contained
  101. syn keyword phtmlFunctions  sybSQL_Query sybSQL_Result sybSQL_Result sybSQL_Seek contained
  102. syn keyword phtmlFunctions  Symlink syslog System Tan TempNam Time Umask UniqId contained
  103. syn keyword phtmlFunctions  Unlink Unset UrlDecode UrlEncode USleep Virtual contained
  104.  
  105. " Identifier
  106. syn match  phtmlIdentifier "$[a-zA-Z_][a-zA-Z0-9_]*" contained contains=phtmlEnvVar,phtmlIntVar
  107.  
  108. " Conditional
  109. syn keyword phtmlConditional  if else elseif endif switch endswitch contained
  110.  
  111. " Repeat
  112. syn keyword phtmlRepeat  while endwhile contained
  113.  
  114. " Repeat
  115. syn keyword phtmlLabel  case default contained
  116.  
  117. " Statement
  118. syn keyword phtmlStatement  break return continue exit contained
  119.  
  120. " Operator
  121. syn match phtmlOperator  "[-=+%^&|*]" contained
  122. syn match phtmlOperator  "[-+*/%^&|]=" contained
  123. syn match phtmlOperator  "/[^*]"me=e-1 contained
  124. syn match phtmlOperator  "/$" contained
  125. syn match phtmlRelation  "&&" contained
  126. syn match phtmlRelation  "||" contained
  127. syn match phtmlRelation  "[!=<>]=" contained
  128. syn match phtmlRelation  "[<>]" contained
  129.  
  130. " Include
  131. syn keyword phtmlInclude  include contained
  132.  
  133. " Definesag
  134. syn keyword phtmlDefine  Function contained
  135.  
  136. " String
  137. syn region phtmlString keepend matchgroup=None start=+"+ skip=+\\\\\|\\"+  end=+"+ contains=phtmlIdentifier,phtmlSpecialChar contained
  138.  
  139. " Number
  140. syn match phtmlNumber  "-\=\<\d\+\>" contained
  141.  
  142. " Float
  143. syn match phtmlFloat  "\(-\=\<\d+\|-\=\)\.\d\+\>" contained
  144.  
  145. " SpecialChar
  146. syn match phtmlSpecialChar "\\[abcfnrtyv\\]" contained
  147. syn match phtmlSpecialChar "\\\d\{3}" contained contains=phtmlOctalError
  148. syn match phtmlSpecialChar "\\x[0-9a-fA-F]\{2}" contained
  149.  
  150. syn match phtmlOctalError "[89]" contained
  151.  
  152.  
  153. syn match phtmlParentError "[)}\]]" contained
  154.  
  155. " Todo
  156. syn keyword phtmlTodo TODO Todo todo contained
  157.  
  158. " Parents
  159. syn region phtmlParent1    matchgroup=Delimiter start="(" end=")" contained contains=phtmlComment,phtmlFunctions,phtmlIdentifier,phtmlConditional,phtmlRepeat,phtmlLabel,phtmlStatement,phtmlOperator,phtmlRelation,phtmlString,phtmlNumber,phtmlFloat,phtmlSpecialChar,phtmlParent1,phtmlParent2,phtmlParent3,phtmlInclude
  160. syn region phtmlParent2    matchgroup=Delimiter start="{" end="}" contained contains=phtmlComment,phtmlFunctions,phtmlIdentifier,phtmlConditional,phtmlRepeat,phtmlLabel,phtmlStatement,phtmlOperator,phtmlRelation,phtmlString,phtmlNumber,phtmlFloat,phtmlSpecialChar,phtmlParent1,phtmlParent2,phtmlParent3,phtmlInclude
  161. syn region phtmlParent3    matchgroup=Delimiter start="\[" end="\]" contained contains=phtmlComment,phtmlFunctions,phtmlIdentifier,phtmlConditional,phtmlRepeat,phtmlLabel,phtmlStatement,phtmlOperator,phtmlRelation,phtmlString,phtmlNumber,phtmlFloat,phtmlSpecialChar,phtmlParent1,phtmlParent2,phtmlParent3,phtmlInclude
  162.  
  163. syn region phtmlRegion keepend matchgroup=Delimiter start="<?" skip=+(.*>.*)\|".*>.*"+ end=">" contains=phtmlComment,phtmlFunctions,phtmlIdentifier,phtmlConditional,phtmlRepeat,phtmlLabel,phtmlStatement,phtmlOperator,phtmlRelation,phtmlInclude,phtmlDefine,phtmlString,phtmlNumber,phtmlFloat,phtmlSpecialChar,phtmlParentError,phtmlTodo,phtmlParent1,phtmlParent2,phtmlParent3
  164.  
  165. if !exists("did_phtml_syntax_inits")
  166.   let did_phtml_syntax_inits = 1
  167.   " The default methods for highlighting.  Can be overridden later
  168.   hi link phtmlComment                   Comment
  169.   hi link phtmlString                    String
  170.   hi link phtmlNumber                    Number
  171.   hi link phtmlFloat                     Float
  172.   hi phtmlIdentifier guifg=DarkGray ctermfg=Brown
  173.   hi link phtmlFunctions                 Function
  174.   hi link phtmlRepeat                    Repeat 
  175.   hi link phtmlConditional               Conditional 
  176.   hi link phtmlLabel                     Label
  177.   hi link phtmlStatement                 Statement
  178.   hi link phtmlType                      Type
  179.   hi link phtmlInclude                   Include
  180.   hi link phtmlDefine                    Define
  181.   hi link phtmlSpecialChar               SpecialChar
  182.   hi link phtmlParentError             Error
  183.   hi link phtmlOctalError             Error
  184.   hi link phtmlTodo                      Todo
  185.   hi phtmlRelation guifg=SeaGreen ctermfg=DarkGreen
  186.   hi phtmlOperator guifg=SeaGreen ctermfg=DarkGreen
  187.   hi phtmlIntVar guifg=Red ctermfg=DarkRed
  188.   hi phtmlEnvVar guifg=Red ctermfg=DarkRed
  189. endif
  190.  
  191. let b:current_syntax = "phtml"
  192.  
  193. " vim: ts=8
  194.