1" Vim syntax file 2" Language: JSP (Java Server Pages) 3" Maintainer: Rafael Garcia-Suarez <[email protected]> 4" URL: http://rgarciasuarez.free.fr/vim/syntax/jsp.vim 5" Last change: 2004 Feb 02 6" Credits : Patch by Darren Greaves (recognizes <jsp:...> tags) 7" Patch by Thomas Kimpton (recognizes jspExpr inside HTML tags) 8 9" quit when a syntax file was already loaded 10if exists("b:current_syntax") 11 finish 12endif 13 14if !exists("main_syntax") 15 let main_syntax = 'jsp' 16endif 17 18" Source HTML syntax 19runtime! syntax/html.vim 20unlet b:current_syntax 21 22" Next syntax items are case-sensitive 23syn case match 24 25" Include Java syntax 26syn include @jspJava syntax/java.vim 27 28syn region jspScriptlet matchgroup=jspTag start=/<%/ keepend end=/%>/ contains=@jspJava 29syn region jspComment start=/<%--/ end=/--%>/ 30syn region jspDecl matchgroup=jspTag start=/<%!/ keepend end=/%>/ contains=@jspJava 31syn region jspExpr matchgroup=jspTag start=/<%=/ keepend end=/%>/ contains=@jspJava 32syn region jspDirective start=/<%@/ end=/%>/ contains=htmlString,jspDirName,jspDirArg 33 34syn keyword jspDirName contained include page taglib 35syn keyword jspDirArg contained file uri prefix language extends import session buffer autoFlush 36syn keyword jspDirArg contained isThreadSafe info errorPage contentType isErrorPage 37syn region jspCommand start=/<jsp:/ start=/<\/jsp:/ keepend end=/>/ end=/\/>/ contains=htmlString,jspCommandName,jspCommandArg 38syn keyword jspCommandName contained include forward getProperty plugin setProperty useBean param params fallback 39syn keyword jspCommandArg contained id scope class type beanName page flush name value property 40syn keyword jspCommandArg contained code codebase name archive align height 41syn keyword jspCommandArg contained width hspace vspace jreversion nspluginurl iepluginurl 42 43" Redefine htmlTag so that it can contain jspExpr 44syn clear htmlTag 45syn region htmlTag start=+<[^/%]+ end=+>+ contains=htmlTagN,htmlString,htmlArg,htmlValue,htmlTagError,htmlEvent,htmlCssDefinition,@htmlPreproc,@htmlArgCluster,jspExpr,javaScript 46 47" Define the default highlighting. 48" Only when an item doesn't have highlighting yet 49command -nargs=+ HiLink hi def link <args> 50" java.vim has redefined htmlComment highlighting 51HiLink htmlComment Comment 52HiLink htmlCommentPart Comment 53" Be consistent with html highlight settings 54HiLink jspComment htmlComment 55HiLink jspTag htmlTag 56HiLink jspDirective jspTag 57HiLink jspDirName htmlTagName 58HiLink jspDirArg htmlArg 59HiLink jspCommand jspTag 60HiLink jspCommandName htmlTagName 61HiLink jspCommandArg htmlArg 62delcommand HiLink 63 64if main_syntax == 'jsp' 65 unlet main_syntax 66endif 67 68let b:current_syntax = "jsp" 69 70" vim: ts=8 71