if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'vim') == -1 " 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 exists("b:current_syntax") finish endif let s:dtd_cpo_save = &cpo set cpo&vim 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,@Spell " proper DTD comment syn region dtdComment contained start=+--+ end=+--+ contains=dtdTodo,@Spell " 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 +