stp.vim 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. " Vim syntax file
  2. " Language: Stored Procedures (STP)
  3. " Maintainer: Jeff Lanzarotta (jefflanzarotta@yahoo.com)
  4. " URL: http://lanzarotta.tripod.com/vim/syntax/stp.vim.zip
  5. " Last Change: March 05, 2002
  6. " quit when a syntax file was already loaded
  7. if exists("b:current_syntax")
  8. finish
  9. endif
  10. syn case ignore
  11. " Specials.
  12. syn keyword stpSpecial null
  13. " Keywords.
  14. syn keyword stpKeyword begin break call case create deallocate dynamic
  15. syn keyword stpKeyword execute from function go grant
  16. syn keyword stpKeyword index insert into leave max min on output procedure
  17. syn keyword stpKeyword public result return returns scroll table to
  18. syn keyword stpKeyword when
  19. syn match stpKeyword "\<end\>"
  20. " Conditional.
  21. syn keyword stpConditional if else elseif then
  22. syn match stpConditional "\<end\s\+if\>"
  23. " Repeats.
  24. syn keyword stpRepeat for while loop
  25. syn match stpRepeat "\<end\s\+loop\>"
  26. " Operators.
  27. syn keyword stpOperator asc not and or desc group having in is any some all
  28. syn keyword stpOperator between exists like escape with union intersect minus
  29. syn keyword stpOperator out prior distinct sysdate
  30. " Statements.
  31. syn keyword stpStatement alter analyze as audit avg by close clustered comment
  32. syn keyword stpStatement commit continue count create cursor declare delete
  33. syn keyword stpStatement drop exec execute explain fetch from index insert
  34. syn keyword stpStatement into lock max min next noaudit nonclustered open
  35. syn keyword stpStatement order output print raiserror recompile rename revoke
  36. syn keyword stpStatement rollback savepoint select set sum transaction
  37. syn keyword stpStatement truncate unique update values where
  38. " Functions.
  39. syn keyword stpFunction abs acos ascii asin atan atn2 avg ceiling charindex
  40. syn keyword stpFunction charlength convert col_name col_length cos cot count
  41. syn keyword stpFunction curunreservedpgs datapgs datalength dateadd datediff
  42. syn keyword stpFunction datename datepart db_id db_name degree difference
  43. syn keyword stpFunction exp floor getdate hextoint host_id host_name index_col
  44. syn keyword stpFunction inttohex isnull lct_admin log log10 lower ltrim max
  45. syn keyword stpFunction min now object_id object_name patindex pi pos power
  46. syn keyword stpFunction proc_role radians rand replace replicate reserved_pgs
  47. syn keyword stpFunction reverse right rtrim rowcnt round show_role sign sin
  48. syn keyword stpFunction soundex space sqrt str stuff substr substring sum
  49. syn keyword stpFunction suser_id suser_name tan tsequal upper used_pgs user
  50. syn keyword stpFunction user_id user_name valid_name valid_user message
  51. " Types.
  52. syn keyword stpType binary bit char datetime decimal double float image
  53. syn keyword stpType int integer long money nchar numeric precision real
  54. syn keyword stpType smalldatetime smallint smallmoney text time tinyint
  55. syn keyword stpType timestamp varbinary varchar
  56. " Globals.
  57. syn match stpGlobals '@@char_convert'
  58. syn match stpGlobals '@@cient_csname'
  59. syn match stpGlobals '@@client_csid'
  60. syn match stpGlobals '@@connections'
  61. syn match stpGlobals '@@cpu_busy'
  62. syn match stpGlobals '@@error'
  63. syn match stpGlobals '@@identity'
  64. syn match stpGlobals '@@idle'
  65. syn match stpGlobals '@@io_busy'
  66. syn match stpGlobals '@@isolation'
  67. syn match stpGlobals '@@langid'
  68. syn match stpGlobals '@@language'
  69. syn match stpGlobals '@@max_connections'
  70. syn match stpGlobals '@@maxcharlen'
  71. syn match stpGlobals '@@ncharsize'
  72. syn match stpGlobals '@@nestlevel'
  73. syn match stpGlobals '@@pack_received'
  74. syn match stpGlobals '@@pack_sent'
  75. syn match stpGlobals '@@packet_errors'
  76. syn match stpGlobals '@@procid'
  77. syn match stpGlobals '@@rowcount'
  78. syn match stpGlobals '@@servername'
  79. syn match stpGlobals '@@spid'
  80. syn match stpGlobals '@@sqlstatus'
  81. syn match stpGlobals '@@testts'
  82. syn match stpGlobals '@@textcolid'
  83. syn match stpGlobals '@@textdbid'
  84. syn match stpGlobals '@@textobjid'
  85. syn match stpGlobals '@@textptr'
  86. syn match stpGlobals '@@textsize'
  87. syn match stpGlobals '@@thresh_hysteresis'
  88. syn match stpGlobals '@@timeticks'
  89. syn match stpGlobals '@@total_error'
  90. syn match stpGlobals '@@total_read'
  91. syn match stpGlobals '@@total_write'
  92. syn match stpGlobals '@@tranchained'
  93. syn match stpGlobals '@@trancount'
  94. syn match stpGlobals '@@transtate'
  95. syn match stpGlobals '@@version'
  96. " Todos.
  97. syn keyword stpTodo TODO FIXME XXX DEBUG NOTE
  98. " Strings and characters.
  99. syn match stpStringError "'.*$"
  100. syn match stpString "'\([^']\|''\)*'"
  101. " Numbers.
  102. syn match stpNumber "-\=\<\d*\.\=[0-9_]\>"
  103. " Comments.
  104. syn region stpComment start="/\*" end="\*/" contains=stpTodo
  105. syn match stpComment "--.*" contains=stpTodo
  106. syn sync ccomment stpComment
  107. " Parens.
  108. syn region stpParen transparent start='(' end=')' contains=ALLBUT,stpParenError
  109. syn match stpParenError ")"
  110. " Syntax Synchronizing.
  111. syn sync minlines=10 maxlines=100
  112. " Define the default highlighting.
  113. " Only when and item doesn't have highlighting yet.
  114. hi def link stpConditional Conditional
  115. hi def link stpComment Comment
  116. hi def link stpKeyword Keyword
  117. hi def link stpNumber Number
  118. hi def link stpOperator Operator
  119. hi def link stpSpecial Special
  120. hi def link stpStatement Statement
  121. hi def link stpString String
  122. hi def link stpStringError Error
  123. hi def link stpType Type
  124. hi def link stpTodo Todo
  125. hi def link stpFunction Function
  126. hi def link stpGlobals Macro
  127. hi def link stpParen Normal
  128. hi def link stpParenError Error
  129. hi def link stpSQLKeyword Function
  130. hi def link stpRepeat Repeat
  131. let b:current_syntax = "stp"
  132. " vim ts=8 sw=2