diff options
Diffstat (limited to 'runtime/syntax/sql.vim')
-rw-r--r-- | runtime/syntax/sql.vim | 110 |
1 files changed, 30 insertions, 80 deletions
diff --git a/runtime/syntax/sql.vim b/runtime/syntax/sql.vim index f9a7c19e3..935dec46d 100644 --- a/runtime/syntax/sql.vim +++ b/runtime/syntax/sql.vim @@ -1,89 +1,39 @@ -" Vim syntax file -" Language: SQL, PL/SQL (Oracle 8i) -" Maintainer: Paul Moore <pf_moore AT yahoo.co.uk> -" Last Change: 2005 Dec 23 - +" Vim syntax file loader +" Language: SQL +" Maintainer: David Fishburn <fishburn at ianywhere dot com> +" Last Change: Thu Sep 15 2005 10:30:02 AM +" Version: 1.0 + +" Description: Checks for a: +" buffer local variable, +" global variable, +" If the above exist, it will source the type specified. +" If none exist, it will source the default sql.vim file. +" " For version 5.x: Clear all syntax items " For version 6.x: Quit when a syntax file was already loaded if version < 600 - syntax clear + syntax clear elseif exists("b:current_syntax") - finish + finish endif -syn case ignore - -" The SQL reserved words, defined as keywords. - -syn keyword sqlSpecial false null true - -syn keyword sqlKeyword access add as asc begin by check cluster column -syn keyword sqlKeyword compress connect current cursor decimal default desc -syn keyword sqlKeyword else elsif end exception exclusive file for from -syn keyword sqlKeyword function group having identified if immediate increment -syn keyword sqlKeyword index initial into is level loop maxextents mode modify -syn keyword sqlKeyword nocompress nowait of offline on online start -syn keyword sqlKeyword successful synonym table then to trigger uid -syn keyword sqlKeyword unique user validate values view whenever -syn keyword sqlKeyword where with option order pctfree privileges procedure -syn keyword sqlKeyword public resource return row rowlabel rownum rows -syn keyword sqlKeyword session share size smallint type using - -syn keyword sqlOperator not and or -syn keyword sqlOperator in any some all between exists -syn keyword sqlOperator like escape -syn keyword sqlOperator union intersect minus -syn keyword sqlOperator prior distinct -syn keyword sqlOperator sysdate out - -syn keyword sqlStatement alter analyze audit comment commit create -syn keyword sqlStatement delete drop execute explain grant insert lock noaudit -syn keyword sqlStatement rename revoke rollback savepoint select set -syn keyword sqlStatement truncate update - -syn keyword sqlType boolean char character date float integer long -syn keyword sqlType mlslabel number raw rowid varchar varchar2 varray - -" Strings and characters: -syn region sqlString start=+"+ skip=+\\\\\|\\"+ end=+"+ -syn region sqlString start=+'+ skip=+\\\\\|\\'+ end=+'+ - -" Numbers: -syn match sqlNumber "-\=\<\d*\.\=[0-9_]\>" - -" Comments: -syn region sqlComment start="/\*" end="\*/" contains=sqlTodo -syn match sqlComment "--.*$" contains=sqlTodo - -syn sync ccomment sqlComment - -" Todo. -syn keyword sqlTodo contained TODO FIXME XXX DEBUG NOTE - -" Define the default highlighting. -" For version 5.7 and earlier: only when not done already -" For version 5.8 and later: only when an item doesn't have highlighting yet -if version >= 508 || !exists("did_sql_syn_inits") - if version < 508 - let did_sql_syn_inits = 1 - command -nargs=+ HiLink hi link <args> - else - command -nargs=+ HiLink hi def link <args> - endif - - HiLink sqlComment Comment - HiLink sqlKeyword sqlSpecial - HiLink sqlNumber Number - HiLink sqlOperator sqlStatement - HiLink sqlSpecial Special - HiLink sqlStatement Statement - HiLink sqlString String - HiLink sqlType Type - HiLink sqlTodo Todo - - delcommand HiLink +" Default to the standard Vim distribution file +let filename = 'sqloracle' + +" Check for overrides. Buffer variables have the highest priority. +if exists("b:sql_type_override") + " Check the runtimepath to see if the file exists + if globpath(&runtimepath, 'syntax/'.b:sql_type_override.'.vim') != '' + let filename = b:sql_type_override + endif +elseif exists("g:sql_type_default") + if globpath(&runtimepath, 'syntax/'.g:sql_type_default.'.vim') != '' + let filename = g:sql_type_default + endif endif -let b:current_syntax = "sql" +" Source the appropriate file +exec 'runtime syntax/'.filename.'.vim' -" vim: ts=8 +" vim:sw=4:ff=unix: |