From 5b77877888162f4e415fe9a7b8c5e9fb5dfb6ee1 Mon Sep 17 00:00:00 2001 From: Adam Stankiewicz Date: Wed, 27 Sep 2017 20:43:42 +0200 Subject: Add syntax files from upstream vim repository --- syntax/dtd.vim | 164 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 164 insertions(+) create mode 100644 syntax/dtd.vim (limited to 'syntax/dtd.vim') diff --git a/syntax/dtd.vim b/syntax/dtd.vim new file mode 100644 index 00000000..8df2f1e4 --- /dev/null +++ b/syntax/dtd.vim @@ -0,0 +1,164 @@ +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 +