sql.vim 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. " 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
  6. " Description: Checks for a:
  7. " buffer local variable,
  8. " global variable,
  9. " If the above exist, it will source the type specified.
  10. " If none exist, it will source the default sql.vim file.
  11. "
  12. " quit when a syntax file was already loaded
  13. if exists("b:current_syntax")
  14. finish
  15. endif
  16. " Default to the standard Vim distribution file
  17. let filename = 'sqloracle'
  18. " Check for overrides. Buffer variables have the highest priority.
  19. if exists("b:sql_type_override")
  20. " Check the runtimepath to see if the file exists
  21. if globpath(&runtimepath, 'syntax/'.b:sql_type_override.'.vim') != ''
  22. let filename = b:sql_type_override
  23. endif
  24. elseif exists("g:sql_type_default")
  25. if globpath(&runtimepath, 'syntax/'.g:sql_type_default.'.vim') != ''
  26. let filename = g:sql_type_default
  27. endif
  28. endif
  29. " Source the appropriate file
  30. exec 'runtime syntax/'.filename.'.vim'
  31. " vim:sw=4: