7
|
1 " Vim syntax file
|
|
2 " Language: SGML-linuxdoc (supported by old sgmltools-1.x)
|
|
3 " (for more information, visit www.sgmltools.org)
|
|
4 " Maintainer: Nam SungHyun <namsh@kldp.org>
|
|
5 " Last Change: 2001 Apr 26
|
|
6
|
|
7 " For version 5.x: Clear all syntax items
|
|
8 " For version 6.x: Quit when a syntax file was already loaded
|
|
9 if version < 600
|
|
10 syntax clear
|
|
11 elseif exists("b:current_syntax")
|
|
12 finish
|
|
13 endif
|
|
14
|
|
15 syn case ignore
|
|
16
|
|
17 " tags
|
|
18 syn region sgmllnxEndTag start=+</+ end=+>+ contains=sgmllnxTagN,sgmllnxTagError
|
|
19 syn region sgmllnxTag start=+<[^/]+ end=+>+ contains=sgmllnxTagN,sgmllnxTagError
|
|
20 syn match sgmllnxTagN contained +<\s*[-a-zA-Z0-9]\++ms=s+1 contains=sgmllnxTagName
|
|
21 syn match sgmllnxTagN contained +</\s*[-a-zA-Z0-9]\++ms=s+2 contains=sgmllnxTagName
|
|
22
|
|
23 syn region sgmllnxTag2 start=+<\s*[a-zA-Z]\+/+ keepend end=+/+ contains=sgmllnxTagN2
|
|
24 syn match sgmllnxTagN2 contained +/.*/+ms=s+1,me=e-1
|
|
25
|
|
26 syn region sgmllnxSpecial oneline start="&" end=";"
|
|
27
|
|
28 " tag names
|
|
29 syn keyword sgmllnxTagName contained article author date toc title sect verb
|
|
30 syn keyword sgmllnxTagName contained abstract tscreen p itemize item enum
|
|
31 syn keyword sgmllnxTagName contained descrip quote htmlurl code ref
|
|
32 syn keyword sgmllnxTagName contained tt tag bf
|
|
33 syn match sgmllnxTagName contained "sect\d\+"
|
|
34
|
|
35 " Comments
|
|
36 syn region sgmllnxComment start=+<!--+ end=+-->+
|
|
37 syn region sgmllnxDocType start=+<!doctype+ end=+>+
|
|
38
|
|
39 " Define the default highlighting.
|
|
40 " For version 5.7 and earlier: only when not done already
|
|
41 " For version 5.8 and later: only when an item doesn't have highlighting yet
|
|
42 if version >= 508 || !exists("did_sgmllnx_syn_inits")
|
|
43 if version < 508
|
|
44 let did_sgmllnx_syn_inits = 1
|
|
45 command -nargs=+ HiLink hi link <args>
|
|
46 else
|
|
47 command -nargs=+ HiLink hi def link <args>
|
|
48 endif
|
|
49
|
|
50 HiLink sgmllnxTag2 Function
|
|
51 HiLink sgmllnxTagN2 Function
|
|
52 HiLink sgmllnxTag Special
|
|
53 HiLink sgmllnxEndTag Special
|
|
54 HiLink sgmllnxParen Special
|
|
55 HiLink sgmllnxEntity Type
|
|
56 HiLink sgmllnxDocEnt Type
|
|
57 HiLink sgmllnxTagName Statement
|
|
58 HiLink sgmllnxComment Comment
|
|
59 HiLink sgmllnxSpecial Special
|
|
60 HiLink sgmllnxDocType PreProc
|
|
61 HiLink sgmllnxTagError Error
|
|
62
|
|
63 delcommand HiLink
|
|
64 endif
|
|
65
|
|
66 let b:current_syntax = "sgmllnx"
|
|
67
|
|
68 " vim:set tw=78 ts=8 sts=2 sw=2 noet:
|