blob: 73bf822e408952b741daf0b373016079d78b5c5c [file] [log] [blame]
Bram Moolenaar071d4272004-06-13 20:20:40 +00001" Vim syntax file
2" Language: WML - Website MetaLanguage
3" Maintainer: Gerfried Fuchs <alfie@ist.org>
4" Filenames: *.wml
5" Last Change: 07 Feb 2002
6" URL: http://alfie.ist.org/software/vim/syntax/wml.vim
7"
8" Original Version: Craig Small <csmall@eye-net.com.au>
9
10" Comments are very welcome - but please make sure that you are commenting on
11" the latest version of this file.
12" SPAM is _NOT_ welcome - be ready to be reported!
13
14" If you are looking for the "Wireless Markup Language" syntax file,
15" please take a look at the wap.vim file done by Ralf Schandl, soon in a
16" vim-package around your corner :)
17
18
Bram Moolenaar89bcfda2016-08-30 23:26:57 +020019" quit when a syntax file was already loaded
20if exists("b:current_syntax")
Bram Moolenaar071d4272004-06-13 20:20:40 +000021 finish
22endif
23
24
25" A lot of the web stuff looks like HTML so we load that first
Bram Moolenaar89bcfda2016-08-30 23:26:57 +020026runtime! syntax/html.vim
Bram Moolenaar071d4272004-06-13 20:20:40 +000027unlet b:current_syntax
28
29if !exists("main_syntax")
30 let main_syntax = 'wml'
31endif
32
33" special character
34syn match wmlNextLine "\\$"
35
36" Redfine htmlTag
37syn clear htmlTag
38syn region htmlTag start=+<[^/<]+ end=+>+ contains=htmlTagN,htmlString,htmlArg,htmlValue,htmlTagError,htmlEvent,htmlCssDefinition
39
40"
41" Add in extra Arguments used by wml
42syn keyword htmlTagName contained gfont imgbg imgdot lowsrc
43syn keyword htmlTagName contained navbar:define navbar:header
44syn keyword htmlTagName contained navbar:footer navbar:prolog
45syn keyword htmlTagName contained navbar:epilog navbar:button
46syn keyword htmlTagName contained navbar:filter navbar:debug
47syn keyword htmlTagName contained navbar:render
48syn keyword htmlTagName contained preload rollover
49syn keyword htmlTagName contained space hspace vspace over
50syn keyword htmlTagName contained ps ds pi ein big sc spaced headline
51syn keyword htmlTagName contained ue subheadline zwue verbcode
52syn keyword htmlTagName contained isolatin pod sdf text url verbatim
53syn keyword htmlTagName contained xtable
54syn keyword htmlTagName contained csmap fsview import box
55syn keyword htmlTagName contained case:upper case:lower
56syn keyword htmlTagName contained grid cell info lang: logo page
57syn keyword htmlTagName contained set-var restore
58syn keyword htmlTagName contained array:push array:show set-var ifdef
59syn keyword htmlTagName contained say m4 symbol dump enter divert
60syn keyword htmlTagName contained toc
61syn keyword htmlTagName contained wml card do refresh oneevent catch spawn
62
63"
64" The wml arguments
65syn keyword htmlArg contained adjust background base bdcolor bdspace
66syn keyword htmlArg contained bdwidth complete copyright created crop
67syn keyword htmlArg contained direction description domainname eperlfilter
68syn keyword htmlArg contained file hint imgbase imgstar interchar interline
69syn keyword htmlArg contained keephr keepindex keywords layout spacing
70syn keyword htmlArg contained padding nonetscape noscale notag notypo
71syn keyword htmlArg contained onload oversrc pos select slices style
72syn keyword htmlArg contained subselected txtcol_select txtcol_normal
73syn keyword htmlArg contained txtonly via
74syn keyword htmlArg contained mode columns localsrc ordered
75
76
77" Lines starting with an # are usually comments
78syn match wmlComment "^\s*#.*"
79" The different exceptions to comments
80syn match wmlSharpBang "^#!.*"
81syn match wmlUsed contained "\s\s*[A-Za-z:_-]*"
82syn match wmlUse "^\s*#\s*use\s\+" contains=wmlUsed
83syn match wmlInclude "^\s*#\s*include.+"
84
85syn region wmlBody contained start=+<<+ end=+>>+
86
87syn match wmlLocationId contained "[A-Za-z]\+"
88syn region wmlLocation start=+<<+ end=+>>+ contains=wmlLocationId
89"syn region wmlLocation start=+{#+ end=+#}+ contains=wmlLocationId
90"syn region wmlLocationed contained start=+<<+ end=+>>+ contains=wmlLocationId
91
92syn match wmlDivert "\.\.[a-zA-Z_]\+>>"
93syn match wmlDivertEnd "<<\.\."
94" new version
95"syn match wmlDivert "{#[a-zA-Z_]\+#:"
96"syn match wmlDivertEnd ":##}"
97
98syn match wmlDefineName contained "\s\+[A-Za-z-]\+"
99syn region htmlTagName start="\<\(define-tag\|define-region\)" end="\>" contains=wmlDefineName
100
101" The perl include stuff
102if main_syntax != 'perl'
103 " Perl script
Bram Moolenaar89bcfda2016-08-30 23:26:57 +0200104 syn include @wmlPerlScript syntax/perl.vim
Bram Moolenaar071d4272004-06-13 20:20:40 +0000105 unlet b:current_syntax
106
107 syn region perlScript start=+<perl>+ keepend end=+</perl>+ contains=@wmlPerlScript,wmlPerlTag
108" eperl between '<:' and ':>' -- Alfie [1999-12-26]
109 syn region perlScript start=+<:+ keepend end=+:>+ contains=@wmlPerlScript,wmlPerlTag
110 syn match wmlPerlTag contained "</*perl>" contains=wmlPerlTagN
111 syn keyword wmlPerlTagN contained perl
112
113 hi link wmlPerlTag htmlTag
114 hi link wmlPerlTagN htmlStatement
115endif
116
117" verbatim tags -- don't highlight anything in between -- Alfie [2002-02-07]
118syn region wmlVerbatimText start=+<verbatim>+ keepend end=+</verbatim>+ contains=wmlVerbatimTag
119syn match wmlVerbatimTag contained "</*verbatim>" contains=wmlVerbatimTagN
120syn keyword wmlVerbatimTagN contained verbatim
121hi link wmlVerbatimTag htmlTag
122hi link wmlVerbatimTagN htmlStatement
123
124if main_syntax == "html"
125 syn sync match wmlHighlight groupthere NONE "</a-zA-Z]"
126 syn sync match wmlHighlight groupthere perlScript "<perl>"
127 syn sync match wmlHighlightSkip "^.*['\"].*$"
128 syn sync minlines=10
129endif
130
131" Define the default highlighting.
Bram Moolenaar89bcfda2016-08-30 23:26:57 +0200132" Only when an item doesn't have highlighting yet
Bram Moolenaar071d4272004-06-13 20:20:40 +0000133
Bram Moolenaarf37506f2016-08-31 22:22:10 +0200134hi def link wmlNextLine Special
135hi def link wmlUse Include
136hi def link wmlUsed String
137hi def link wmlBody Special
138hi def link wmlDiverted Label
139hi def link wmlDivert Delimiter
140hi def link wmlDivertEnd Delimiter
141hi def link wmlLocationId Label
142hi def link wmlLocation Delimiter
143" hi def link wmlLocationed Delimiter
144hi def link wmlDefineName String
145hi def link wmlComment Comment
146hi def link wmlInclude Include
147hi def link wmlSharpBang PreProc
Bram Moolenaar071d4272004-06-13 20:20:40 +0000148
Bram Moolenaar071d4272004-06-13 20:20:40 +0000149
150let b:current_syntax = "wml"