2 " Language: SGML-DTD (supported by sgmltools-2.x and DocBook)
3 " For more information, visit
4 " http://nis-www.lanl.gov/~rosalia/mydocs/docbook-intro.html
5 " ftp://sourceware.cygnus.com/pub/docbook-tools
6 " Maintainer: Sung-Hyun Nam <namsh@kldp.org>
7 " If you want to enhance and maintain, You can remove my name
9 " Last Change: 2001 May 10
11 " For version 5.x: Clear all syntax items
12 " For version 6.x: Quit when a syntax file was already loaded
15 elseif exists("b:current_syntax")
19 let sgml_cpo_save = &cpo
25 syn match sgmlTagError ">"
26 syn match sgmlErrInTag contained "<"
27 syn region sgmlEndTag start=+</[a-zA-Z]+ end=+>+ contains=sgmlTagName
28 syn match sgmlEndTag "</>"
29 syn region sgmlTag start=+<[a-zA-Z]+ end=+>+
30 \ contains=sgmlTagName,sgmlAssign
31 syn region sgmlStr contained start=+L\="+ end=+"+
32 syn region sgmlAssign contained start=+=+hs=e+1 end=+[ \t\>]+me=s-1
34 syn region sgmlSpecial oneline start="&" end=";"
35 syn region sgmlComment start=+<!--+ end=+-->+
36 syn region sgmlDocEnt contained start="<!\(entity\|element\)\s" end=">"
38 syn region sgmlDocEntI contained start=+\[+ end=+]+ contains=sgmlDocEnt
39 syn region sgmlDocType start=+<!doctype\s+ end=+>+
40 \ contains=sgmlDocEntI,sgmlStr
42 " tag names for DTD DocBook V3.[01]
43 syn match sgmlTagName contained "sect\d\+"
44 syn match sgmlTagName contained "sect\d\+info"
45 syn match sgmlTagName contained "refsect\d\+"
46 syn keyword sgmlTagName contained abbrev abstract accel acronym action address
47 \ affiliation alt anchor answer appendix
49 \ area areaset areaspec arg artheader article
50 \ artpagenums attribution author authorblurb
51 \ authorgroup authorinitials bibliodiv
52 \ biblioentry bibliography bibliomixed
53 \ bibliomset biblioset blockquote book
54 \ bookbiblio bookinfo bridgehead callout
55 \ calloutlist caption caution chapter citation
56 \ citerefentry citetitle city classname
57 \ cmdsynopsis colophon colspec command comment
58 \ computeroutput constant copyright corpauthor
59 \ corpname country database date dedication
60 \ docinfo edition editor email emphasis entry
61 \ envar epigraph equation errorcode errorname
62 \ errortype example fax figure filename
63 \ firstname firstterm footnote footnoteref
64 \ foreignphrase formalpara funcdef funcparams
65 \ funcprototype funcsynopsis funcsynopsisinfo
66 \ function glossary glossdef glossdiv
67 \ glossentry glosslist glosssee glossseealso
68 \ glossterm graphic group guibutton guiicon
69 \ guilabel guimenu guimenuitem guisubmenu
70 \ hardware holder honorific imagedata
71 \ imageobject important index indexdiv
72 \ indexentry indexterm informalequation
73 \ informalexample informalfigure informaltable
74 \ inlineequation inlinegraphic
75 \ inlinemediaobject interface
76 \ interfacedefinition isbn issn issuenum
77 \ itemizedlist jobtitle keycap keycode
78 \ keycombo keysym legalnotice lineannotation
79 \ link listitem literal literallayout manvolnum
80 \ markup medialabel mediaobject member
81 \ mousebutton msg msgaud msgentry msgexplan
82 \ msginfo msglevel msgmain msgorig msgrel
83 \ msgset msgsub msgtext note objectinfo option
84 \ optional orderedlist orgdiv orgname
85 \ otheraddr othername pagenums para paramdef
86 \ parameter part partintro phone phrase
87 \ postcode preface primary primaryie procedure
88 \ productname programlisting programlistingco
89 \ prompt property pubdate publisher
90 \ publishername qandadiv qandaentry qandaset
91 \ question quote refdescriptor refentry
92 \ refentrytitle reference refmeta refmiscinfo
94 \ refnamediv refpurpose refsynopsisdiv
95 \ releaseinfo replaceable returnvalue
96 \ revhistory revision revnumber revremark row
97 \ sbr screen screeninfo screenshot secondary
98 \ secondaryie section see seealso seealsoie
99 \ seeie seg seglistitem segmentedlist segtitle
100 \ seriesinfo set setinfo sgmltag shortaffil
101 \ sidebar simpara simplelist simplesect
102 \ spanspec state step street structfield
103 \ structname subscript substeps subtitle
104 \ superscript surname symbol synopsis
105 \ systemitem table tbody term tertiaryie
106 \ textobject tgroup thead tip title
107 \ titleabbrev toc token trademark type ulink
108 \ userinput varargs variablelist varlistentry
109 \ varname videodata videoobject void volumenum
110 \ warning wordasword xref year
112 " Define the default highlighting.
113 " For version 5.7 and earlier: only when not done already
114 " For version 5.8 and later: only when an item doesn't have highlighting yet
115 if version >= 508 || !exists("did_sgml_syntax_inits")
117 let did_sgml_syntax_inits = 1
118 command -nargs=+ HiLink hi link <args>
120 command -nargs=+ HiLink hi def link <args>
123 HiLink sgmlTag Special
124 HiLink sgmlEndTag Special
125 HiLink sgmlEntity Type
126 HiLink sgmlDocEnt Type
127 HiLink sgmlTagName Statement
128 HiLink sgmlComment Comment
129 HiLink sgmlSpecial Special
130 HiLink sgmlDocType PreProc
131 HiLink sgmlStr String
132 HiLink sgmlAssign String
133 HiLink sgmlTagError Error
134 HiLink sgmlErrInTag Error
139 let b:current_syntax = "sgml"
141 let &cpo = sgml_cpo_save
144 " vim:set tw=78 ts=8 sts=2 sw=2 noet com=nb\:":