blob: 3e9459267b9bca8b21d59abdbb59423de4a8c719 [file] [log] [blame]
Bram Moolenaar071d4272004-06-13 20:20:40 +00001" Vim syntax file
Bram Moolenaar071d4272004-06-13 20:20:40 +00002" Language: lilo configuration (lilo.conf)
Bram Moolenaar6dfc28b2010-02-11 14:19:15 +01003" Maintainer: Niels Horn <niels.horn@gmail.com>
Bram Moolenaar5c736222010-01-06 20:54:52 +01004" Previous Maintainer: David Necas (Yeti) <yeti@physics.muni.cz>
Bram Moolenaar6dfc28b2010-02-11 14:19:15 +01005" Last Change: 2010-02-03
Bram Moolenaar5eb86f92004-07-26 12:53:41 +00006
Bram Moolenaar071d4272004-06-13 20:20:40 +00007" Setup
8if version >= 600
Bram Moolenaar5eb86f92004-07-26 12:53:41 +00009 if exists("b:current_syntax")
10 finish
11 endif
Bram Moolenaar071d4272004-06-13 20:20:40 +000012else
Bram Moolenaar5eb86f92004-07-26 12:53:41 +000013 syntax clear
Bram Moolenaar071d4272004-06-13 20:20:40 +000014endif
15
16if version >= 600
Bram Moolenaar5eb86f92004-07-26 12:53:41 +000017 command -nargs=1 SetIsk setlocal iskeyword=<args>
Bram Moolenaar071d4272004-06-13 20:20:40 +000018else
Bram Moolenaar5eb86f92004-07-26 12:53:41 +000019 command -nargs=1 SetIsk set iskeyword=<args>
Bram Moolenaar071d4272004-06-13 20:20:40 +000020endif
21SetIsk @,48-57,.,-,_
22delcommand SetIsk
23
24syn case ignore
25
26" Base constructs
27syn match liloError "\S\+"
28syn match liloComment "#.*$"
29syn match liloEnviron "\$\w\+" contained
30syn match liloEnviron "\${[^}]\+}" contained
31syn match liloDecNumber "\d\+" contained
32syn match liloHexNumber "0[xX]\x\+" contained
33syn match liloDecNumberP "\d\+p\=" contained
34syn match liloSpecial contained "\\\(\"\|\\\|$\)"
35syn region liloString start=+"+ skip=+\\\\\|\\"+ end=+"+ contained contains=liloSpecial,liloEnviron
Bram Moolenaar5eb86f92004-07-26 12:53:41 +000036syn match liloLabel :[^ "]\+: contained contains=liloSpecial,liloEnviron
Bram Moolenaar071d4272004-06-13 20:20:40 +000037syn region liloPath start=+[$/]+ skip=+\\\\\|\\ \|\\$"+ end=+ \|$+ contained contains=liloSpecial,liloEnviron
38syn match liloDecNumberList "\(\d\|,\)\+" contained contains=liloDecNumber
39syn match liloDecNumberPList "\(\d\|[,p]\)\+" contained contains=liloDecNumberP,liloDecNumber
40syn region liloAnything start=+[^[:space:]#]+ skip=+\\\\\|\\ \|\\$+ end=+ \|$+ contained contains=liloSpecial,liloEnviron,liloString
41
42" Path
Bram Moolenaar5eb86f92004-07-26 12:53:41 +000043syn keyword liloOption backup bitmap boot disktab force-backup keytable map message nextgroup=liloEqPath,liloEqPathComment,liloError skipwhite skipempty
Bram Moolenaar071d4272004-06-13 20:20:40 +000044syn keyword liloKernelOpt initrd root nextgroup=liloEqPath,liloEqPathComment,liloError skipwhite skipempty
45syn keyword liloImageOpt path loader table nextgroup=liloEqPath,liloEqPathComment,liloError skipwhite skipempty
46syn keyword liloDiskOpt partition nextgroup=liloEqPath,liloEqPathComment,liloError skipwhite skipempty
47
48" Other
Bram Moolenaar5eb86f92004-07-26 12:53:41 +000049syn keyword liloOption menu-scheme raid-extra-boot serial install nextgroup=liloEqAnything,liloEqAnythingComment,liloError skipwhite skipempty
50syn keyword liloOption bios-passes-dl nextgroup=liloEqAnything,liloEqAnythingComment,liloError skipwhite skipempty
51syn keyword liloOption default label alias wmdefault nextgroup=liloEqLabelString,liloEqLabelStringComment,liloError skipwhite skipempty
Bram Moolenaar071d4272004-06-13 20:20:40 +000052syn keyword liloKernelOpt ramdisk nextgroup=liloEqAnything,liloEqAnythingComment,liloError skipwhite skipempty
Bram Moolenaar071d4272004-06-13 20:20:40 +000053syn keyword liloImageOpt password range nextgroup=liloEqAnything,liloEqAnythingComment,liloError skipwhite skipempty
54syn keyword liloDiskOpt set type nextgroup=liloEqAnything,liloEqAnythingComment,liloError skipwhite skipempty
55
56" Symbolic
57syn keyword liloKernelOpt vga nextgroup=liloEqVga,liloEqVgaComment,liloError skipwhite skipempty
58
59" Number
60syn keyword liloOption delay timeout verbose nextgroup=liloEqDecNumber,liloEqDecNumberComment,liloError skipwhite skipempty
61syn keyword liloDiskOpt sectors heads cylinders start nextgroup=liloEqDecNumber,liloEqDecNumberComment,liloError skipwhite skipempty
62
63" String
64syn keyword liloOption menu-title nextgroup=liloEqString,liloEqStringComment,liloError skipwhite skipempty
Bram Moolenaar5c736222010-01-06 20:54:52 +010065syn keyword liloKernelOpt append addappend nextgroup=liloEqString,liloEqStringComment,liloError skipwhite skipempty
Bram Moolenaar071d4272004-06-13 20:20:40 +000066syn keyword liloImageOpt fallback literal nextgroup=liloEqString,liloEqStringComment,liloError skipwhite skipempty
67
68" Hex number
Bram Moolenaar5eb86f92004-07-26 12:53:41 +000069syn keyword liloImageOpt map-drive to boot-as nextgroup=liloEqHexNumber,liloEqHexNumberComment,liloError skipwhite skipempty
Bram Moolenaar071d4272004-06-13 20:20:40 +000070syn keyword liloDiskOpt bios normal hidden nextgroup=liloEqNumber,liloEqNumberComment,liloError skipwhite skipempty
71
72" Number list
Bram Moolenaar5eb86f92004-07-26 12:53:41 +000073syn keyword liloOption bmp-colors nextgroup=liloEqNumberList,liloEqNumberListComment,liloError skipwhite skipempty
Bram Moolenaar071d4272004-06-13 20:20:40 +000074
75" Number list, some of the numbers followed by p
Bram Moolenaar5eb86f92004-07-26 12:53:41 +000076syn keyword liloOption bmp-table bmp-timer nextgroup=liloEqDecNumberPList,liloEqDecNumberPListComment,liloError skipwhite skipempty
Bram Moolenaar071d4272004-06-13 20:20:40 +000077
78" Flag
79syn keyword liloOption compact fix-table geometric ignore-table lba32 linear mandatory nowarn prompt
Bram Moolenaar5eb86f92004-07-26 12:53:41 +000080syn keyword liloOption bmp-retain el-torito-bootable-CD large-memory suppress-boot-time-BIOS-data
Bram Moolenaar071d4272004-06-13 20:20:40 +000081syn keyword liloKernelOpt read-only read-write
82syn keyword liloImageOpt bypass lock mandatory optional restricted single-key unsafe
Bram Moolenaar5eb86f92004-07-26 12:53:41 +000083syn keyword liloImageOpt master-boot wmwarn wmdisable
Bram Moolenaar071d4272004-06-13 20:20:40 +000084syn keyword liloDiskOpt change activate deactivate inaccessible reset
85
86" Image
87syn keyword liloImage image other nextgroup=liloEqPath,liloEqPathComment,liloError skipwhite skipempty
88syn keyword liloDisk disk nextgroup=liloEqPath,liloEqPathComment,liloError skipwhite skipempty
89syn keyword liloChRules change-rules
90
91" Vga keywords
92syn keyword liloVgaKeyword ask ext extended normal contained
93
94" Comment followed by equal sign and ...
95syn match liloEqPathComment "#.*$" contained nextgroup=liloEqPath,liloEqPathComment,liloError skipwhite skipempty
96syn match liloEqVgaComment "#.*$" contained nextgroup=liloEqVga,liloEqVgaComment,liloError skipwhite skipempty
97syn match liloEqNumberComment "#.*$" contained nextgroup=liloEqNumber,liloEqNumberComment,liloError skipwhite skipempty
98syn match liloEqDecNumberComment "#.*$" contained nextgroup=liloEqDecNumber,liloEqDecNumberComment,liloError skipwhite skipempty
99syn match liloEqHexNumberComment "#.*$" contained nextgroup=liloEqHexNumber,liloEqHexNumberComment,liloError skipwhite skipempty
100syn match liloEqStringComment "#.*$" contained nextgroup=liloEqString,liloEqStringComment,liloError skipwhite skipempty
Bram Moolenaar5eb86f92004-07-26 12:53:41 +0000101syn match liloEqLabelStringComment "#.*$" contained nextgroup=liloEqLabelString,liloEqLabelStringComment,liloError skipwhite skipempty
Bram Moolenaar071d4272004-06-13 20:20:40 +0000102syn match liloEqNumberListComment "#.*$" contained nextgroup=liloEqNumberList,liloEqNumberListComment,liloError skipwhite skipempty
103syn match liloEqDecNumberPListComment "#.*$" contained nextgroup=liloEqDecNumberPList,liloEqDecNumberPListComment,liloError skipwhite skipempty
104syn match liloEqAnythingComment "#.*$" contained nextgroup=liloEqAnything,liloEqAnythingComment,liloError skipwhite skipempty
105
106" Equal sign followed by ...
107syn match liloEqPath "=" contained nextgroup=liloPath,liloPathComment,liloError skipwhite skipempty
108syn match liloEqVga "=" contained nextgroup=liloVgaKeyword,liloHexNumber,liloDecNumber,liloVgaComment,liloError skipwhite skipempty
109syn match liloEqNumber "=" contained nextgroup=liloDecNumber,liloHexNumber,liloNumberComment,liloError skipwhite skipempty
110syn match liloEqDecNumber "=" contained nextgroup=liloDecNumber,liloDecNumberComment,liloError skipwhite skipempty
111syn match liloEqHexNumber "=" contained nextgroup=liloHexNumber,liloHexNumberComment,liloError skipwhite skipempty
112syn match liloEqString "=" contained nextgroup=liloString,liloStringComment,liloError skipwhite skipempty
Bram Moolenaar5eb86f92004-07-26 12:53:41 +0000113syn match liloEqLabelString "=" contained nextgroup=liloString,liloLabel,liloLabelStringComment,liloError skipwhite skipempty
Bram Moolenaar071d4272004-06-13 20:20:40 +0000114syn match liloEqNumberList "=" contained nextgroup=liloDecNumberList,liloDecNumberListComment,liloError skipwhite skipempty
115syn match liloEqDecNumberPList "=" contained nextgroup=liloDecNumberPList,liloDecNumberPListComment,liloError skipwhite skipempty
116syn match liloEqAnything "=" contained nextgroup=liloAnything,liloAnythingComment,liloError skipwhite skipempty
117
118" Comment followed by ...
119syn match liloPathComment "#.*$" contained nextgroup=liloPath,liloPathComment,liloError skipwhite skipempty
120syn match liloVgaComment "#.*$" contained nextgroup=liloVgaKeyword,liloHexNumber,liloVgaComment,liloError skipwhite skipempty
121syn match liloNumberComment "#.*$" contained nextgroup=liloDecNumber,liloHexNumber,liloNumberComment,liloError skipwhite skipempty
122syn match liloDecNumberComment "#.*$" contained nextgroup=liloDecNumber,liloDecNumberComment,liloError skipwhite skipempty
123syn match liloHexNumberComment "#.*$" contained nextgroup=liloHexNumber,liloHexNumberComment,liloError skipwhite skipempty
124syn match liloStringComment "#.*$" contained nextgroup=liloString,liloStringComment,liloError skipwhite skipempty
Bram Moolenaar5eb86f92004-07-26 12:53:41 +0000125syn match liloLabelStringComment "#.*$" contained nextgroup=liloString,liloLabel,liloLabelStringComment,liloError skipwhite skipempty
Bram Moolenaar071d4272004-06-13 20:20:40 +0000126syn match liloDecNumberListComment "#.*$" contained nextgroup=liloDecNumberList,liloDecNumberListComment,liloError skipwhite skipempty
127syn match liloDecNumberPListComment "#.*$" contained nextgroup=liloDecNumberPList,liloDecNumberPListComment,liloError skipwhite skipempty
128syn match liloAnythingComment "#.*$" contained nextgroup=liloAnything,liloAnythingComment,liloError skipwhite skipempty
129
130" Define the default highlighting
131if version >= 508 || !exists("did_lilo_syntax_inits")
Bram Moolenaar5eb86f92004-07-26 12:53:41 +0000132 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
Bram Moolenaar071d4272004-06-13 20:20:40 +0000138
Bram Moolenaar5eb86f92004-07-26 12:53:41 +0000139 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
Bram Moolenaar071d4272004-06-13 20:20:40 +0000148
Bram Moolenaar5eb86f92004-07-26 12:53:41 +0000149 HiLink liloError Error
Bram Moolenaar071d4272004-06-13 20:20:40 +0000150
Bram Moolenaar5eb86f92004-07-26 12:53:41 +0000151 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
Bram Moolenaar071d4272004-06-13 20:20:40 +0000165
Bram Moolenaar5eb86f92004-07-26 12:53:41 +0000166 HiLink liloDiskOpt liloOption
167 HiLink liloKernelOpt liloOption
168 HiLink liloImageOpt liloOption
169 HiLink liloOption Keyword
Bram Moolenaar071d4272004-06-13 20:20:40 +0000170
Bram Moolenaar5eb86f92004-07-26 12:53:41 +0000171 HiLink liloDecNumber liloNumber
172 HiLink liloHexNumber liloNumber
173 HiLink liloDecNumberP liloNumber
174 HiLink liloNumber Number
175 HiLink liloString String
176 HiLink liloPath Constant
Bram Moolenaar071d4272004-06-13 20:20:40 +0000177
Bram Moolenaar5eb86f92004-07-26 12:53:41 +0000178 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
Bram Moolenaar071d4272004-06-13 20:20:40 +0000188
Bram Moolenaar5eb86f92004-07-26 12:53:41 +0000189 delcommand HiLink
Bram Moolenaar071d4272004-06-13 20:20:40 +0000190endif
191
192let b:current_syntax = "lilo"