wsh.vim 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. " Vim syntax file
  2. " Language: Windows Scripting Host
  3. " Maintainer: Paul Moore <pf_moore AT yahoo.co.uk>
  4. " Last Change: Fre, 24 Nov 2000 21:54:09 +0100
  5. " This reuses the XML, VB and JavaScript syntax files. While VB is not
  6. " VBScript, it's close enough for us. No attempt is made to handle
  7. " other languages.
  8. " Send comments, suggestions and requests to the maintainer.
  9. " Quit when a syntax file was already loaded
  10. if exists("b:current_syntax")
  11. finish
  12. endif
  13. let s:wsh_cpo_save = &cpo
  14. set cpo&vim
  15. runtime! syntax/xml.vim
  16. unlet b:current_syntax
  17. syn case ignore
  18. syn include @wshVBScript <sfile>:p:h/vb.vim
  19. unlet b:current_syntax
  20. syn include @wshJavaScript <sfile>:p:h/javascript.vim
  21. unlet b:current_syntax
  22. syn region wshVBScript
  23. \ matchgroup=xmlTag start="<script[^>]*VBScript\(>\|[^>]*[^/>]>\)"
  24. \ matchgroup=xmlEndTag end="</script>"
  25. \ fold
  26. \ contains=@wshVBScript
  27. \ keepend
  28. syn region wshJavaScript
  29. \ matchgroup=xmlTag start="<script[^>]*J\(ava\)\=Script\(>\|[^>]*[^/>]>\)"
  30. \ matchgroup=xmlEndTag end="</script>"
  31. \ fold
  32. \ contains=@wshJavaScript
  33. \ keepend
  34. syn cluster xmlRegionHook add=wshVBScript,wshJavaScript
  35. let b:current_syntax = "wsh"
  36. let &cpo = s:wsh_cpo_save
  37. unlet s:wsh_cpo_save