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