" Vim syntax file " Language: DTD (Document Type Definition for XML) " Maintainer: Johannes Zellner " Author and previous maintainer: " Daniel Amyot " Last change: Dec 09 1999 " Filenames: *.dtd " URL: http://www.zellner.org/vim/syntax/dtd.vim " $Id: dtd.vim,v 1.3 1999/12/10 18:29:50 joze Exp $ " " " CREDITS: " - original note of Daniel Amyot : " This file is an adaptation of pascal.vim by Mario Eusebio " I'm not sure I understand all of the syntax highlight language, " but this file seems to do the job for simple DTD in XML. " This would have to be extended to cover the whole of SGML DTDs though. " Unfortunately, I don't know enough about the somewhat complex SGML " to do it myself. Volunteers are most welcomed! " " " REFERENCES: " http://www.w3.org/TR/html40/ " http://www.w3.org/TR/NOTE-html-970421 " " TODO: " - improve synchronizing. syn clear 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'. syn region dtdTag matchgroup=dtdFunction start=++ matchgroup=NONE contains=dtdTag,dtdTagName,dtdError,dtdComment,dtdString,dtdAttrType,dtdAttrDef,dtdEnum,dtdParamEntityInst,dtdParamEntityDecl,dtdCard 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 +