blob: 935dec46da481bf0c4dfe56911753bb53c40c2b6 [file] [log] [blame]
Bram Moolenaar1056d982006-03-09 22:37:52 +00001" Vim syntax file loader
2" Language: SQL
3" Maintainer: David Fishburn <fishburn at ianywhere dot com>
4" Last Change: Thu Sep 15 2005 10:30:02 AM
5" Version: 1.0
Bram Moolenaar071d4272004-06-13 20:20:40 +00006
Bram Moolenaar1056d982006-03-09 22:37:52 +00007" Description: Checks for a:
8" buffer local variable,
9" global variable,
10" If the above exist, it will source the type specified.
11" If none exist, it will source the default sql.vim file.
12"
Bram Moolenaar071d4272004-06-13 20:20:40 +000013" For version 5.x: Clear all syntax items
14" For version 6.x: Quit when a syntax file was already loaded
15if version < 600
Bram Moolenaar1056d982006-03-09 22:37:52 +000016 syntax clear
Bram Moolenaar071d4272004-06-13 20:20:40 +000017elseif exists("b:current_syntax")
Bram Moolenaar1056d982006-03-09 22:37:52 +000018 finish
Bram Moolenaar071d4272004-06-13 20:20:40 +000019endif
20
Bram Moolenaar1056d982006-03-09 22:37:52 +000021" Default to the standard Vim distribution file
22let filename = 'sqloracle'
Bram Moolenaar071d4272004-06-13 20:20:40 +000023
Bram Moolenaar1056d982006-03-09 22:37:52 +000024" Check for overrides. Buffer variables have the highest priority.
25if exists("b:sql_type_override")
26 " Check the runtimepath to see if the file exists
27 if globpath(&runtimepath, 'syntax/'.b:sql_type_override.'.vim') != ''
28 let filename = b:sql_type_override
29 endif
30elseif exists("g:sql_type_default")
31 if globpath(&runtimepath, 'syntax/'.g:sql_type_default.'.vim') != ''
32 let filename = g:sql_type_default
33 endif
Bram Moolenaar071d4272004-06-13 20:20:40 +000034endif
35
Bram Moolenaar1056d982006-03-09 22:37:52 +000036" Source the appropriate file
37exec 'runtime syntax/'.filename.'.vim'
Bram Moolenaar071d4272004-06-13 20:20:40 +000038
Bram Moolenaar1056d982006-03-09 22:37:52 +000039" vim:sw=4:ff=unix: