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