2 " Language: JSP (Java Server Pages)
3 " Maintainer: Rafael Garcia-Suarez <rgarciasuarez@free.fr>
4 " URL: http://rgarciasuarez.free.fr/vim/syntax/jsp.vim
5 " Last change: 2001 Apr 29
7 " For version 5.x: Clear all syntax items
8 " For version 6.x: Quit when a syntax file was already loaded
11 elseif exists("b:current_syntax")
15 if !exists("main_syntax")
16 let main_syntax = 'jsp'
21 source <sfile>:p:h/html.vim
23 runtime! syntax/html.vim
25 unlet b:current_syntax
27 " Next syntax items are case-sensitive
31 syn include @jspJava <sfile>:p:h/java.vim
33 syn region jspScriptlet matchgroup=jspTag start=/<%/ keepend end=/%>/ contains=@jspJava
34 syn region jspComment start=/<%--/ end=/--%>/
35 syn region jspDecl matchgroup=jspTag start=/<%!/ keepend end=/%>/ contains=@jspJava
36 syn region jspExpr matchgroup=jspTag start=/<%=/ keepend end=/%>/ contains=@jspJava
37 syn region jspDirective start=/<%@/ end=/%>/ contains=htmlString,jspDirName,jspDirArg
39 syn keyword jspDirName contained include page taglib
40 syn keyword jspDirArg contained file uri prefix language extends import session buffer autoFlush
41 syn keyword jspDirArg contained isThreadSafe info errorPage contentType isErrorPage
43 " Define the default highlighting.
44 " For version 5.7 and earlier: only when not done already
45 " For version 5.8 and later: only when an item doesn't have highlighting yet
46 if version >= 508 || !exists("did_jsp_syn_inits")
48 let did_jsp_syn_inits = 1
49 command -nargs=+ HiLink hi link <args>
51 command -nargs=+ HiLink hi def link <args>
53 " java.vim has redefined htmlComment highlighting
54 HiLink htmlComment Comment
55 HiLink htmlCommentPart Comment
56 " Be consistent with html highlight settings
57 HiLink jspComment htmlComment
59 HiLink jspDirective jspTag
60 HiLink jspDirName htmlTagName
61 HiLink jspDirArg htmlArg
65 if main_syntax == 'jsp'
69 let b:current_syntax = "jsp"