7
|
1 " Vim syntax file
|
|
2 " Language: HMTL Tidy configuration file ( /etc/tidyrc ~/.tidyrc )
|
36
|
3 " Maintainer: Doug Kearns <djkea2@gus.gscit.monash.edu.au>
|
|
4 " URL: http://gus.gscit.monash.edu.au/~djkea2/vim/syntax/tidy.vim
|
548
|
5 " Last Change: 2005 Oct 06
|
7
|
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 if version < 600
|
|
16 set iskeyword=@,48-57,-
|
|
17 else
|
|
18 setlocal iskeyword=@,48-57,-
|
|
19 endif
|
|
20
|
|
21 syn match tidyComment "^\s*//.*$" contains=tidyTodo
|
|
22 syn match tidyComment "^\s*#.*$" contains=tidyTodo
|
|
23 syn keyword tidyTodo TODO NOTE FIXME XXX contained
|
|
24
|
|
25 syn match tidyAssignment "^[a-z0-9-]\+:\s*.*$" contains=tidyOption,@tidyValue,tidyDelimiter
|
|
26 syn match tidyDelimiter ":" contained
|
|
27
|
|
28 syn match tidyNewTagAssignment "^new-\l\+-tags:\s*.*$" contains=tidyNewTagOption,tidyNewTagDelimiter,tidyNewTagValue,tidyDelimiter
|
|
29 syn match tidyNewTagDelimiter "," contained
|
|
30 syn match tidyNewTagValue "\<\w\+\>" contained
|
|
31
|
|
32 syn case ignore
|
|
33 syn keyword tidyBoolean t[rue] f[alse] y[es] n[o] contained
|
|
34 syn case match
|
548
|
35 syn match tidyDoctype "\<omit\|auto\|strict\|loose\|transitional\|user\>" contained
|
|
36 " NOTE: use match rather than keyword here so that tidyEncoding 'raw' does not
|
|
37 " always have precedence over tidyOption 'raw'
|
|
38 syn match tidyEncoding "\<\(ascii\|latin0\|latin1\|raw\|utf8\|iso2022\|mac\|utf16le\|utf16be\|utf16\|win1252\|ibm858\|big5\|shiftjis\)\>" contained
|
|
39 syn match tidyNewline "\<\(LF\|CRLF\|CR\)\>"
|
7
|
40 syn match tidyNumber "\<\d\+\>" contained
|
|
41 syn match tidyRepeat "\<keep-first\|keep-last\>" contained
|
|
42 syn region tidyString start=+"+ skip=+\\\\\|\\"+ end=+"+ contained oneline
|
|
43 syn region tidyString start=+'+ skip=+\\\\\|\\'+ end=+'+ contained oneline
|
548
|
44 syn cluster tidyValue contains=tidyBoolean,tidyDoctype,tidyEncoding,tidyNewline,tidyNumber,tidyRepeat,tidyString
|
7
|
45
|
|
46 syn match tidyOption "^accessibility-check" contained
|
|
47 syn match tidyOption "^add-xml-decl" contained
|
|
48 syn match tidyOption "^add-xml-pi" contained
|
|
49 syn match tidyOption "^add-xml-space" contained
|
|
50 syn match tidyOption "^alt-text" contained
|
|
51 syn match tidyOption "^ascii-chars" contained
|
|
52 syn match tidyOption "^assume-xml-procins" contained
|
|
53 syn match tidyOption "^bare" contained
|
|
54 syn match tidyOption "^break-before-br" contained
|
|
55 syn match tidyOption "^char-encoding" contained
|
|
56 syn match tidyOption "^clean" contained
|
|
57 syn match tidyOption "^css-prefix" contained
|
|
58 syn match tidyOption "^doctype" contained
|
548
|
59 syn match tidyOption "^doctype-mode" contained
|
7
|
60 syn match tidyOption "^drop-empty-paras" contained
|
|
61 syn match tidyOption "^drop-font-tags" contained
|
|
62 syn match tidyOption "^drop-proprietary-attributes" contained
|
|
63 syn match tidyOption "^enclose-block-text" contained
|
|
64 syn match tidyOption "^enclose-text" contained
|
|
65 syn match tidyOption "^error-file" contained
|
|
66 syn match tidyOption "^escape-cdata" contained
|
|
67 syn match tidyOption "^fix-backslash" contained
|
|
68 syn match tidyOption "^fix-bad-comments" contained
|
|
69 syn match tidyOption "^fix-uri" contained
|
|
70 syn match tidyOption "^force-output" contained
|
|
71 syn match tidyOption "^gnu-emacs" contained
|
548
|
72 syn match tidyOption "^gnu-emacs-file" contained
|
7
|
73 syn match tidyOption "^hide-comments" contained
|
|
74 syn match tidyOption "^hide-endtags" contained
|
|
75 syn match tidyOption "^indent" contained
|
|
76 syn match tidyOption "^indent-attributes" contained
|
|
77 syn match tidyOption "^indent-cdata" contained
|
|
78 syn match tidyOption "^indent-spaces" contained
|
|
79 syn match tidyOption "^input-encoding" contained
|
|
80 syn match tidyOption "^input-xml" contained
|
|
81 syn match tidyOption "^join-classes" contained
|
|
82 syn match tidyOption "^join-styles" contained
|
|
83 syn match tidyOption "^keep-time" contained
|
|
84 syn match tidyOption "^language" contained
|
|
85 syn match tidyOption "^literal-attributes" contained
|
|
86 syn match tidyOption "^logical-emphasis" contained
|
|
87 syn match tidyOption "^lower-literals" contained
|
|
88 syn match tidyOption "^markup" contained
|
548
|
89 syn match tidyOption "^merge-divs" contained
|
7
|
90 syn match tidyOption "^ncr" contained
|
548
|
91 syn match tidyOption "^newline" contained
|
7
|
92 syn match tidyOption "^numeric-entities" contained
|
|
93 syn match tidyOption "^output-bom" contained
|
|
94 syn match tidyOption "^output-encoding" contained
|
548
|
95 syn match tidyOption "^output-file" contained
|
7
|
96 syn match tidyOption "^output-html" contained
|
|
97 syn match tidyOption "^output-xhtml" contained
|
|
98 syn match tidyOption "^output-xml" contained
|
548
|
99 syn match tidyOption "^punctuation-wrap" contained
|
7
|
100 syn match tidyOption "^quiet" contained
|
|
101 syn match tidyOption "^quote-ampersand" contained
|
|
102 syn match tidyOption "^quote-marks" contained
|
|
103 syn match tidyOption "^quote-nbsp" contained
|
|
104 syn match tidyOption "^raw" contained
|
|
105 syn match tidyOption "^repeated-attributes" contained
|
|
106 syn match tidyOption "^replace-color" contained
|
|
107 syn match tidyOption "^show-body-only" contained
|
|
108 syn match tidyOption "^show-errors" contained
|
|
109 syn match tidyOption "^show-warnings" contained
|
|
110 syn match tidyOption "^slide-style" contained
|
|
111 syn match tidyOption "^split" contained
|
|
112 syn match tidyOption "^tab-size" contained
|
|
113 syn match tidyOption "^tidy-mark" contained
|
|
114 syn match tidyOption "^uppercase-attributes" contained
|
|
115 syn match tidyOption "^uppercase-tags" contained
|
|
116 syn match tidyOption "^word-2000" contained
|
|
117 syn match tidyOption "^wrap" contained
|
|
118 syn match tidyOption "^wrap-asp" contained
|
|
119 syn match tidyOption "^wrap-attributes" contained
|
|
120 syn match tidyOption "^wrap-jste" contained
|
|
121 syn match tidyOption "^wrap-php" contained
|
|
122 syn match tidyOption "^wrap-script-literals" contained
|
|
123 syn match tidyOption "^wrap-sections" contained
|
|
124 syn match tidyOption "^write-back" contained
|
548
|
125 syn match tidyOption "^vertical-space" contained
|
7
|
126 syn match tidyNewTagOption "^new-blocklevel-tags" contained
|
|
127 syn match tidyNewTagOption "^new-empty-tags" contained
|
|
128 syn match tidyNewTagOption "^new-inline-tags" contained
|
|
129 syn match tidyNewTagOption "^new-pre-tags" contained
|
|
130
|
|
131 " Define the default highlighting.
|
|
132 " For version 5.7 and earlier: only when not done already
|
|
133 " For version 5.8 and later: only when an item doesn't have highlighting yet
|
|
134 if version >= 508 || !exists("did_tidy_syn_inits")
|
|
135 if version < 508
|
|
136 let did_tidy_syn_inits = 1
|
|
137 command -nargs=+ HiLink hi link <args>
|
|
138 else
|
|
139 command -nargs=+ HiLink hi def link <args>
|
|
140 endif
|
|
141
|
|
142 HiLink tidyBoolean Boolean
|
|
143 HiLink tidyComment Comment
|
|
144 HiLink tidyDelimiter Special
|
|
145 HiLink tidyDoctype Constant
|
|
146 HiLink tidyEncoding Constant
|
548
|
147 HiLink tidyNewline Constant
|
7
|
148 HiLink tidyNewTagDelimiter Special
|
|
149 HiLink tidyNewTagOption Identifier
|
|
150 HiLink tidyNewTagValue Constant
|
|
151 HiLink tidyNumber Number
|
|
152 HiLink tidyOption Identifier
|
|
153 HiLink tidyRepeat Constant
|
|
154 HiLink tidyString String
|
|
155 HiLink tidyTodo Todo
|
|
156
|
|
157 delcommand HiLink
|
|
158 endif
|
|
159
|
|
160 let b:current_syntax = "tidy"
|
|
161
|
|
162 " vim: ts=8
|