720
|
1 " Vim syntax file
|
|
2 " Language: SQL, PL/SQL (Oracle 8i)
|
|
3 " Maintainer: Paul Moore <pf_moore AT yahoo.co.uk>
|
|
4 " Last Change: 2005 Dec 23
|
|
5
|
|
6 " For version 5.x: Clear all syntax items
|
|
7 " For version 6.x: Quit when a syntax file was already loaded
|
|
8 if version < 600
|
|
9 syntax clear
|
|
10 elseif exists("b:current_syntax")
|
|
11 finish
|
|
12 endif
|
|
13
|
|
14 syn case ignore
|
|
15
|
|
16 " The SQL reserved words, defined as keywords.
|
|
17
|
|
18 syn keyword sqlSpecial false null true
|
|
19
|
|
20 syn keyword sqlKeyword access add as asc begin by check cluster column
|
|
21 syn keyword sqlKeyword compress connect current cursor decimal default desc
|
|
22 syn keyword sqlKeyword else elsif end exception exclusive file for from
|
|
23 syn keyword sqlKeyword function group having identified if immediate increment
|
|
24 syn keyword sqlKeyword index initial into is level loop maxextents mode modify
|
|
25 syn keyword sqlKeyword nocompress nowait of offline on online start
|
|
26 syn keyword sqlKeyword successful synonym table then to trigger uid
|
|
27 syn keyword sqlKeyword unique user validate values view whenever
|
|
28 syn keyword sqlKeyword where with option order pctfree privileges procedure
|
|
29 syn keyword sqlKeyword public resource return row rowlabel rownum rows
|
|
30 syn keyword sqlKeyword session share size smallint type using
|
|
31
|
|
32 syn keyword sqlOperator not and or
|
|
33 syn keyword sqlOperator in any some all between exists
|
|
34 syn keyword sqlOperator like escape
|
|
35 syn keyword sqlOperator union intersect minus
|
|
36 syn keyword sqlOperator prior distinct
|
|
37 syn keyword sqlOperator sysdate out
|
|
38
|
|
39 syn keyword sqlStatement alter analyze audit comment commit create
|
|
40 syn keyword sqlStatement delete drop execute explain grant insert lock noaudit
|
|
41 syn keyword sqlStatement rename revoke rollback savepoint select set
|
|
42 syn keyword sqlStatement truncate update
|
|
43
|
|
44 syn keyword sqlType boolean char character date float integer long
|
|
45 syn keyword sqlType mlslabel number raw rowid varchar varchar2 varray
|
|
46
|
|
47 " Strings and characters:
|
|
48 syn region sqlString start=+"+ skip=+\\\\\|\\"+ end=+"+
|
|
49 syn region sqlString start=+'+ skip=+\\\\\|\\'+ end=+'+
|
|
50
|
|
51 " Numbers:
|
|
52 syn match sqlNumber "-\=\<\d*\.\=[0-9_]\>"
|
|
53
|
|
54 " Comments:
|
|
55 syn region sqlComment start="/\*" end="\*/" contains=sqlTodo
|
|
56 syn match sqlComment "--.*$" contains=sqlTodo
|
|
57
|
|
58 syn sync ccomment sqlComment
|
|
59
|
|
60 " Todo.
|
|
61 syn keyword sqlTodo contained TODO FIXME XXX DEBUG NOTE
|
|
62
|
|
63 " Define the default highlighting.
|
|
64 " For version 5.7 and earlier: only when not done already
|
|
65 " For version 5.8 and later: only when an item doesn't have highlighting yet
|
|
66 if version >= 508 || !exists("did_sql_syn_inits")
|
|
67 if version < 508
|
|
68 let did_sql_syn_inits = 1
|
|
69 command -nargs=+ HiLink hi link <args>
|
|
70 else
|
|
71 command -nargs=+ HiLink hi def link <args>
|
|
72 endif
|
|
73
|
|
74 HiLink sqlComment Comment
|
|
75 HiLink sqlKeyword sqlSpecial
|
|
76 HiLink sqlNumber Number
|
|
77 HiLink sqlOperator sqlStatement
|
|
78 HiLink sqlSpecial Special
|
|
79 HiLink sqlStatement Statement
|
|
80 HiLink sqlString String
|
|
81 HiLink sqlType Type
|
|
82 HiLink sqlTodo Todo
|
|
83
|
|
84 delcommand HiLink
|
|
85 endif
|
|
86
|
|
87 let b:current_syntax = "sql"
|
|
88
|
|
89 " vim: ts=8
|