7
|
1 " Vim syntax file
|
|
2 " Language: lilo configuration (lilo.conf)
|
2072
|
3 " Maintainer: Niels Horn <niels.horn@gmail.com>
|
2034
|
4 " Previous Maintainer: David Necas (Yeti) <yeti@physics.muni.cz>
|
2072
|
5 " Last Change: 2010-02-03
|
20
|
6
|
7
|
7 " Setup
|
|
8 if version >= 600
|
20
|
9 if exists("b:current_syntax")
|
|
10 finish
|
|
11 endif
|
7
|
12 else
|
20
|
13 syntax clear
|
7
|
14 endif
|
|
15
|
|
16 if version >= 600
|
20
|
17 command -nargs=1 SetIsk setlocal iskeyword=<args>
|
7
|
18 else
|
20
|
19 command -nargs=1 SetIsk set iskeyword=<args>
|
7
|
20 endif
|
|
21 SetIsk @,48-57,.,-,_
|
|
22 delcommand SetIsk
|
|
23
|
|
24 syn case ignore
|
|
25
|
|
26 " Base constructs
|
|
27 syn match liloError "\S\+"
|
|
28 syn match liloComment "#.*$"
|
|
29 syn match liloEnviron "\$\w\+" contained
|
|
30 syn match liloEnviron "\${[^}]\+}" contained
|
|
31 syn match liloDecNumber "\d\+" contained
|
|
32 syn match liloHexNumber "0[xX]\x\+" contained
|
|
33 syn match liloDecNumberP "\d\+p\=" contained
|
|
34 syn match liloSpecial contained "\\\(\"\|\\\|$\)"
|
|
35 syn region liloString start=+"+ skip=+\\\\\|\\"+ end=+"+ contained contains=liloSpecial,liloEnviron
|
20
|
36 syn match liloLabel :[^ "]\+: contained contains=liloSpecial,liloEnviron
|
7
|
37 syn region liloPath start=+[$/]+ skip=+\\\\\|\\ \|\\$"+ end=+ \|$+ contained contains=liloSpecial,liloEnviron
|
|
38 syn match liloDecNumberList "\(\d\|,\)\+" contained contains=liloDecNumber
|
|
39 syn match liloDecNumberPList "\(\d\|[,p]\)\+" contained contains=liloDecNumberP,liloDecNumber
|
|
40 syn region liloAnything start=+[^[:space:]#]+ skip=+\\\\\|\\ \|\\$+ end=+ \|$+ contained contains=liloSpecial,liloEnviron,liloString
|
|
41
|
|
42 " Path
|
20
|
43 syn keyword liloOption backup bitmap boot disktab force-backup keytable map message nextgroup=liloEqPath,liloEqPathComment,liloError skipwhite skipempty
|
7
|
44 syn keyword liloKernelOpt initrd root nextgroup=liloEqPath,liloEqPathComment,liloError skipwhite skipempty
|
|
45 syn keyword liloImageOpt path loader table nextgroup=liloEqPath,liloEqPathComment,liloError skipwhite skipempty
|
|
46 syn keyword liloDiskOpt partition nextgroup=liloEqPath,liloEqPathComment,liloError skipwhite skipempty
|
|
47
|
|
48 " Other
|
20
|
49 syn keyword liloOption menu-scheme raid-extra-boot serial install nextgroup=liloEqAnything,liloEqAnythingComment,liloError skipwhite skipempty
|
|
50 syn keyword liloOption bios-passes-dl nextgroup=liloEqAnything,liloEqAnythingComment,liloError skipwhite skipempty
|
|
51 syn keyword liloOption default label alias wmdefault nextgroup=liloEqLabelString,liloEqLabelStringComment,liloError skipwhite skipempty
|
7
|
52 syn keyword liloKernelOpt ramdisk nextgroup=liloEqAnything,liloEqAnythingComment,liloError skipwhite skipempty
|
|
53 syn keyword liloImageOpt password range nextgroup=liloEqAnything,liloEqAnythingComment,liloError skipwhite skipempty
|
|
54 syn keyword liloDiskOpt set type nextgroup=liloEqAnything,liloEqAnythingComment,liloError skipwhite skipempty
|
|
55
|
|
56 " Symbolic
|
|
57 syn keyword liloKernelOpt vga nextgroup=liloEqVga,liloEqVgaComment,liloError skipwhite skipempty
|
|
58
|
|
59 " Number
|
|
60 syn keyword liloOption delay timeout verbose nextgroup=liloEqDecNumber,liloEqDecNumberComment,liloError skipwhite skipempty
|
|
61 syn keyword liloDiskOpt sectors heads cylinders start nextgroup=liloEqDecNumber,liloEqDecNumberComment,liloError skipwhite skipempty
|
|
62
|
|
63 " String
|
|
64 syn keyword liloOption menu-title nextgroup=liloEqString,liloEqStringComment,liloError skipwhite skipempty
|
2034
|
65 syn keyword liloKernelOpt append addappend nextgroup=liloEqString,liloEqStringComment,liloError skipwhite skipempty
|
7
|
66 syn keyword liloImageOpt fallback literal nextgroup=liloEqString,liloEqStringComment,liloError skipwhite skipempty
|
|
67
|
|
68 " Hex number
|
20
|
69 syn keyword liloImageOpt map-drive to boot-as nextgroup=liloEqHexNumber,liloEqHexNumberComment,liloError skipwhite skipempty
|
7
|
70 syn keyword liloDiskOpt bios normal hidden nextgroup=liloEqNumber,liloEqNumberComment,liloError skipwhite skipempty
|
|
71
|
|
72 " Number list
|
20
|
73 syn keyword liloOption bmp-colors nextgroup=liloEqNumberList,liloEqNumberListComment,liloError skipwhite skipempty
|
7
|
74
|
|
75 " Number list, some of the numbers followed by p
|
20
|
76 syn keyword liloOption bmp-table bmp-timer nextgroup=liloEqDecNumberPList,liloEqDecNumberPListComment,liloError skipwhite skipempty
|
7
|
77
|
|
78 " Flag
|
|
79 syn keyword liloOption compact fix-table geometric ignore-table lba32 linear mandatory nowarn prompt
|
20
|
80 syn keyword liloOption bmp-retain el-torito-bootable-CD large-memory suppress-boot-time-BIOS-data
|
7
|
81 syn keyword liloKernelOpt read-only read-write
|
|
82 syn keyword liloImageOpt bypass lock mandatory optional restricted single-key unsafe
|
20
|
83 syn keyword liloImageOpt master-boot wmwarn wmdisable
|
7
|
84 syn keyword liloDiskOpt change activate deactivate inaccessible reset
|
|
85
|
|
86 " Image
|
|
87 syn keyword liloImage image other nextgroup=liloEqPath,liloEqPathComment,liloError skipwhite skipempty
|
|
88 syn keyword liloDisk disk nextgroup=liloEqPath,liloEqPathComment,liloError skipwhite skipempty
|
|
89 syn keyword liloChRules change-rules
|
|
90
|
|
91 " Vga keywords
|
|
92 syn keyword liloVgaKeyword ask ext extended normal contained
|
|
93
|
|
94 " Comment followed by equal sign and ...
|
|
95 syn match liloEqPathComment "#.*$" contained nextgroup=liloEqPath,liloEqPathComment,liloError skipwhite skipempty
|
|
96 syn match liloEqVgaComment "#.*$" contained nextgroup=liloEqVga,liloEqVgaComment,liloError skipwhite skipempty
|
|
97 syn match liloEqNumberComment "#.*$" contained nextgroup=liloEqNumber,liloEqNumberComment,liloError skipwhite skipempty
|
|
98 syn match liloEqDecNumberComment "#.*$" contained nextgroup=liloEqDecNumber,liloEqDecNumberComment,liloError skipwhite skipempty
|
|
99 syn match liloEqHexNumberComment "#.*$" contained nextgroup=liloEqHexNumber,liloEqHexNumberComment,liloError skipwhite skipempty
|
|
100 syn match liloEqStringComment "#.*$" contained nextgroup=liloEqString,liloEqStringComment,liloError skipwhite skipempty
|
20
|
101 syn match liloEqLabelStringComment "#.*$" contained nextgroup=liloEqLabelString,liloEqLabelStringComment,liloError skipwhite skipempty
|
7
|
102 syn match liloEqNumberListComment "#.*$" contained nextgroup=liloEqNumberList,liloEqNumberListComment,liloError skipwhite skipempty
|
|
103 syn match liloEqDecNumberPListComment "#.*$" contained nextgroup=liloEqDecNumberPList,liloEqDecNumberPListComment,liloError skipwhite skipempty
|
|
104 syn match liloEqAnythingComment "#.*$" contained nextgroup=liloEqAnything,liloEqAnythingComment,liloError skipwhite skipempty
|
|
105
|
|
106 " Equal sign followed by ...
|
|
107 syn match liloEqPath "=" contained nextgroup=liloPath,liloPathComment,liloError skipwhite skipempty
|
|
108 syn match liloEqVga "=" contained nextgroup=liloVgaKeyword,liloHexNumber,liloDecNumber,liloVgaComment,liloError skipwhite skipempty
|
|
109 syn match liloEqNumber "=" contained nextgroup=liloDecNumber,liloHexNumber,liloNumberComment,liloError skipwhite skipempty
|
|
110 syn match liloEqDecNumber "=" contained nextgroup=liloDecNumber,liloDecNumberComment,liloError skipwhite skipempty
|
|
111 syn match liloEqHexNumber "=" contained nextgroup=liloHexNumber,liloHexNumberComment,liloError skipwhite skipempty
|
|
112 syn match liloEqString "=" contained nextgroup=liloString,liloStringComment,liloError skipwhite skipempty
|
20
|
113 syn match liloEqLabelString "=" contained nextgroup=liloString,liloLabel,liloLabelStringComment,liloError skipwhite skipempty
|
7
|
114 syn match liloEqNumberList "=" contained nextgroup=liloDecNumberList,liloDecNumberListComment,liloError skipwhite skipempty
|
|
115 syn match liloEqDecNumberPList "=" contained nextgroup=liloDecNumberPList,liloDecNumberPListComment,liloError skipwhite skipempty
|
|
116 syn match liloEqAnything "=" contained nextgroup=liloAnything,liloAnythingComment,liloError skipwhite skipempty
|
|
117
|
|
118 " Comment followed by ...
|
|
119 syn match liloPathComment "#.*$" contained nextgroup=liloPath,liloPathComment,liloError skipwhite skipempty
|
|
120 syn match liloVgaComment "#.*$" contained nextgroup=liloVgaKeyword,liloHexNumber,liloVgaComment,liloError skipwhite skipempty
|
|
121 syn match liloNumberComment "#.*$" contained nextgroup=liloDecNumber,liloHexNumber,liloNumberComment,liloError skipwhite skipempty
|
|
122 syn match liloDecNumberComment "#.*$" contained nextgroup=liloDecNumber,liloDecNumberComment,liloError skipwhite skipempty
|
|
123 syn match liloHexNumberComment "#.*$" contained nextgroup=liloHexNumber,liloHexNumberComment,liloError skipwhite skipempty
|
|
124 syn match liloStringComment "#.*$" contained nextgroup=liloString,liloStringComment,liloError skipwhite skipempty
|
20
|
125 syn match liloLabelStringComment "#.*$" contained nextgroup=liloString,liloLabel,liloLabelStringComment,liloError skipwhite skipempty
|
7
|
126 syn match liloDecNumberListComment "#.*$" contained nextgroup=liloDecNumberList,liloDecNumberListComment,liloError skipwhite skipempty
|
|
127 syn match liloDecNumberPListComment "#.*$" contained nextgroup=liloDecNumberPList,liloDecNumberPListComment,liloError skipwhite skipempty
|
|
128 syn match liloAnythingComment "#.*$" contained nextgroup=liloAnything,liloAnythingComment,liloError skipwhite skipempty
|
|
129
|
|
130 " Define the default highlighting
|
|
131 if version >= 508 || !exists("did_lilo_syntax_inits")
|
20
|
132 if version < 508
|
|
133 let did_lilo_syntax_inits = 1
|
|
134 command -nargs=+ HiLink hi link <args>
|
|
135 else
|
|
136 command -nargs=+ HiLink hi def link <args>
|
|
137 endif
|
7
|
138
|
20
|
139 HiLink liloEqPath liloEquals
|
|
140 HiLink liloEqWord liloEquals
|
|
141 HiLink liloEqVga liloEquals
|
|
142 HiLink liloEqDecNumber liloEquals
|
|
143 HiLink liloEqHexNumber liloEquals
|
|
144 HiLink liloEqNumber liloEquals
|
|
145 HiLink liloEqString liloEquals
|
|
146 HiLink liloEqAnything liloEquals
|
|
147 HiLink liloEquals Special
|
7
|
148
|
20
|
149 HiLink liloError Error
|
7
|
150
|
20
|
151 HiLink liloEqPathComment liloComment
|
|
152 HiLink liloEqVgaComment liloComment
|
|
153 HiLink liloEqDecNumberComment liloComment
|
|
154 HiLink liloEqHexNumberComment liloComment
|
|
155 HiLink liloEqStringComment liloComment
|
|
156 HiLink liloEqAnythingComment liloComment
|
|
157 HiLink liloPathComment liloComment
|
|
158 HiLink liloVgaComment liloComment
|
|
159 HiLink liloDecNumberComment liloComment
|
|
160 HiLink liloHexNumberComment liloComment
|
|
161 HiLink liloNumberComment liloComment
|
|
162 HiLink liloStringComment liloComment
|
|
163 HiLink liloAnythingComment liloComment
|
|
164 HiLink liloComment Comment
|
|
165
|
|
166 HiLink liloDiskOpt liloOption
|
|
167 HiLink liloKernelOpt liloOption
|
|
168 HiLink liloImageOpt liloOption
|
|
169 HiLink liloOption Keyword
|
7
|
170
|
20
|
171 HiLink liloDecNumber liloNumber
|
|
172 HiLink liloHexNumber liloNumber
|
|
173 HiLink liloDecNumberP liloNumber
|
|
174 HiLink liloNumber Number
|
|
175 HiLink liloString String
|
|
176 HiLink liloPath Constant
|
7
|
177
|
20
|
178 HiLink liloSpecial Special
|
|
179 HiLink liloLabel Title
|
|
180 HiLink liloDecNumberList Special
|
|
181 HiLink liloDecNumberPList Special
|
|
182 HiLink liloAnything Normal
|
|
183 HiLink liloEnviron Identifier
|
|
184 HiLink liloVgaKeyword Identifier
|
|
185 HiLink liloImage Type
|
|
186 HiLink liloChRules Preproc
|
|
187 HiLink liloDisk Preproc
|
7
|
188
|
20
|
189 delcommand HiLink
|
7
|
190 endif
|
|
191
|
|
192 let b:current_syntax = "lilo"
|