Merge branch 'hack/autopaste'
[vim-kana.git] / runtime / syntax / wsh.vim
blob4b664a177e5b95e97e9dd0ad8322434edafecee3
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
6 " This reuses the XML, VB and JavaScript syntax files. While VB is not
7 " VBScript, it's close enough for us. No attempt is made to handle
8 " other languages.
9 " Send comments, suggestions and requests to the maintainer.
11 " Quit when a syntax file was already loaded
12 if exists("b:current_syntax")
13   finish
14 endif
16 let s:wsh_cpo_save = &cpo
17 set cpo&vim
19 runtime! syntax/xml.vim
20 unlet b:current_syntax
22 syn case ignore
23 syn include @wshVBScript <sfile>:p:h/vb.vim
24 unlet b:current_syntax
25 syn include @wshJavaScript <sfile>:p:h/javascript.vim
26 unlet b:current_syntax
27 syn region wshVBScript
28     \ matchgroup=xmlTag    start="<script[^>]*VBScript\(>\|[^>]*[^/>]>\)"
29     \ matchgroup=xmlEndTag end="</script>"
30     \ fold
31     \ contains=@wshVBScript
32     \ keepend
33 syn region wshJavaScript
34     \ matchgroup=xmlTag    start="<script[^>]*J\(ava\)\=Script\(>\|[^>]*[^/>]>\)"
35     \ matchgroup=xmlEndTag end="</script>"
36     \ fold
37     \ contains=@wshJavaScript
38     \ keepend
40 syn cluster xmlRegionHook add=wshVBScript,wshJavaScript
42 let b:current_syntax = "wsh"
44 let &cpo = s:wsh_cpo_save
45 unlet s:wsh_cpo_save