blob: 6de3f4a5c0c301ed12f90d8e44947b0ae30eca28 [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:
Bram Moolenaarc9b4b052006-04-30 18:54:39 +00008" buffer local variable,
9" global variable,
Bram Moolenaar1056d982006-03-09 22:37:52 +000010" If the above exist, it will source the type specified.
11" If none exist, it will source the default sql.vim file.
12"
Bram Moolenaar89bcfda2016-08-30 23:26:57 +020013" quit when a syntax file was already loaded
14if exists("b:current_syntax")
Bram Moolenaar1056d982006-03-09 22:37:52 +000015 finish
Bram Moolenaar071d4272004-06-13 20:20:40 +000016endif
17
Bram Moolenaar1056d982006-03-09 22:37:52 +000018" Default to the standard Vim distribution file
19let filename = 'sqloracle'
Bram Moolenaar071d4272004-06-13 20:20:40 +000020
Bram Moolenaar1056d982006-03-09 22:37:52 +000021" Check for overrides. Buffer variables have the highest priority.
22if exists("b:sql_type_override")
23 " Check the runtimepath to see if the file exists
24 if globpath(&runtimepath, 'syntax/'.b:sql_type_override.'.vim') != ''
25 let filename = b:sql_type_override
26 endif
27elseif exists("g:sql_type_default")
28 if globpath(&runtimepath, 'syntax/'.g:sql_type_default.'.vim') != ''
29 let filename = g:sql_type_default
30 endif
Bram Moolenaar071d4272004-06-13 20:20:40 +000031endif
32
Bram Moolenaar1056d982006-03-09 22:37:52 +000033" Source the appropriate file
34exec 'runtime syntax/'.filename.'.vim'
Bram Moolenaar071d4272004-06-13 20:20:40 +000035
Bram Moolenaar8c8de832008-06-24 22:58:06 +000036" vim:sw=4: