" Vim syntax file " Language: DTD (Document Type Definition for XML) " Maintainer: Johannes Zellner " Author and previous maintainer: " Daniel Amyot " Last Change: Tue, 27 Apr 2004 14:54:59 CEST " Filenames: *.dtd " " REFERENCES: " http://www.w3.org/TR/html40/ " http://www.w3.org/TR/NOTE-html-970421 " " TODO: " - improve synchronizing. if version < 600 syntax clear let __dtd_cpo_save__ = &cpo set cpo& else if exists("b:current_syntax") finish endif let s:dtd_cpo_save = &cpo set cpo&vim endif if !exists("dtd_ignore_case") " I prefer having the case takes into consideration. syn case match else syn case ignore endif " the following line makes the opening highlighted using 'dtdFunction'. " " PROVIDES: @dtdTagHook " syn region dtdTag matchgroup=dtdFunction \ start=++ matchgroup=NONE \ contains=dtdTag,dtdTagName,dtdError,dtdComment,dtdString,dtdAttrType,dtdAttrDef,dtdEnum,dtdParamEntityInst,dtdParamEntityDecl,dtdCard,@dtdTagHook if !exists("dtd_no_tag_errors") " mark everything as an error which starts with a + endif " if this is a html like comment hightlight also " the opening as Comment. syn region dtdComment start=++ contains=dtdTodo " proper DTD comment syn region dtdComment contained start=+--+ end=+--+ contains=dtdTodo " Start tags (keywords). This is contained in dtdFunction. " Note that everything not contained here will be marked " as error. syn match dtdTagName contained +" \ matchgroup=NONE contains=dtdParamEntityPunct syn match dtdParamEntityPunct contained "\." " declarations " syn region dtdParamEntityDecl oneline matchgroup=dtdParamEntityDPunct start=+" contains=dtdParamEntityDPunct syn match dtdParamEntityDecl += 508 || !exists("did_dtd_syn_inits") if version < 508 let did_dtd_syn_inits = 1 command -nargs=+ HiLink hi link else command -nargs=+ HiLink hi def link endif " The default highlighting. HiLink dtdFunction Function HiLink dtdTag Normal HiLink dtdType Type HiLink dtdAttrType dtdType HiLink dtdAttrDef dtdType HiLink dtdConstant Constant HiLink dtdString dtdConstant HiLink dtdEnum dtdConstant HiLink dtdCard dtdFunction HiLink dtdEntity Statement HiLink dtdEntityPunct dtdType HiLink dtdParamEntityInst dtdConstant HiLink dtdParamEntityPunct dtdType HiLink dtdParamEntityDecl dtdType HiLink dtdParamEntityDPunct dtdComment HiLink dtdComment Comment HiLink dtdTagName Statement HiLink dtdError Error HiLink dtdTodo Todo delcommand HiLink endif if version < 600 let &cpo = __dtd_cpo_save__ unlet __dtd_cpo_save__ else let &cpo = s:dtd_cpo_save unlet s:dtd_cpo_save endif let b:current_syntax = "dtd" " vim: ts=8