sql.vim 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. " Vim indent file loader
  2. " Language: SQL
  3. " Maintainer: David Fishburn <fishburn at ianywhere dot com>
  4. " Last Change: Thu Sep 15 2005 10:27:51 AM
  5. " Version: 1.0
  6. " Download: http://vim.sourceforge.net/script.php?script_id=495
  7. " 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 sqlanywhere.vim file.
  12. " Only load this indent file when no other was loaded.
  13. if exists("b:did_indent")
  14. finish
  15. endif
  16. " Default to the standard Vim distribution file
  17. let filename = 'sqlanywhere'
  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, 'indent/'.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, 'indent/'.g:sql_type_default.'.vim') != ''
  26. let filename = g:sql_type_default
  27. endif
  28. endif
  29. " Source the appropriate file
  30. exec 'runtime indent/'.filename.'.vim'
  31. " vim:sw=4: