blob: f58e34061c2fbe91b37d858a24c735dc5720a5a4 [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
Bram Moolenaar89bcfda2016-08-30 23:26:57 +02008" quit when a syntax file was already loaded
9if exists("b:current_syntax")
10 finish
Bram Moolenaar071d4272004-06-13 20:20:40 +000011endif
12
Bram Moolenaar89bcfda2016-08-30 23:26:57 +020013setlocal iskeyword=@,48-57,.,-,_
Bram Moolenaar071d4272004-06-13 20:20:40 +000014
15syn case ignore
16
17" Base constructs
18syn match liloError "\S\+"
19syn match liloComment "#.*$"
20syn match liloEnviron "\$\w\+" contained
21syn match liloEnviron "\${[^}]\+}" contained
22syn match liloDecNumber "\d\+" contained
23syn match liloHexNumber "0[xX]\x\+" contained
24syn match liloDecNumberP "\d\+p\=" contained
25syn match liloSpecial contained "\\\(\"\|\\\|$\)"
26syn region liloString start=+"+ skip=+\\\\\|\\"+ end=+"+ contained contains=liloSpecial,liloEnviron
Bram Moolenaar5eb86f92004-07-26 12:53:41 +000027syn match liloLabel :[^ "]\+: contained contains=liloSpecial,liloEnviron
Bram Moolenaar071d4272004-06-13 20:20:40 +000028syn region liloPath start=+[$/]+ skip=+\\\\\|\\ \|\\$"+ end=+ \|$+ contained contains=liloSpecial,liloEnviron
29syn match liloDecNumberList "\(\d\|,\)\+" contained contains=liloDecNumber
30syn match liloDecNumberPList "\(\d\|[,p]\)\+" contained contains=liloDecNumberP,liloDecNumber
31syn region liloAnything start=+[^[:space:]#]+ skip=+\\\\\|\\ \|\\$+ end=+ \|$+ contained contains=liloSpecial,liloEnviron,liloString
32
33" Path
Bram Moolenaar5eb86f92004-07-26 12:53:41 +000034syn keyword liloOption backup bitmap boot disktab force-backup keytable map message nextgroup=liloEqPath,liloEqPathComment,liloError skipwhite skipempty
Bram Moolenaar071d4272004-06-13 20:20:40 +000035syn keyword liloKernelOpt initrd root nextgroup=liloEqPath,liloEqPathComment,liloError skipwhite skipempty
36syn keyword liloImageOpt path loader table nextgroup=liloEqPath,liloEqPathComment,liloError skipwhite skipempty
37syn keyword liloDiskOpt partition nextgroup=liloEqPath,liloEqPathComment,liloError skipwhite skipempty
38
39" Other
Bram Moolenaar5eb86f92004-07-26 12:53:41 +000040syn keyword liloOption menu-scheme raid-extra-boot serial install nextgroup=liloEqAnything,liloEqAnythingComment,liloError skipwhite skipempty
41syn keyword liloOption bios-passes-dl nextgroup=liloEqAnything,liloEqAnythingComment,liloError skipwhite skipempty
42syn keyword liloOption default label alias wmdefault nextgroup=liloEqLabelString,liloEqLabelStringComment,liloError skipwhite skipempty
Bram Moolenaar071d4272004-06-13 20:20:40 +000043syn keyword liloKernelOpt ramdisk nextgroup=liloEqAnything,liloEqAnythingComment,liloError skipwhite skipempty
Bram Moolenaar071d4272004-06-13 20:20:40 +000044syn keyword liloImageOpt password range nextgroup=liloEqAnything,liloEqAnythingComment,liloError skipwhite skipempty
45syn keyword liloDiskOpt set type nextgroup=liloEqAnything,liloEqAnythingComment,liloError skipwhite skipempty
46
47" Symbolic
48syn keyword liloKernelOpt vga nextgroup=liloEqVga,liloEqVgaComment,liloError skipwhite skipempty
49
50" Number
51syn keyword liloOption delay timeout verbose nextgroup=liloEqDecNumber,liloEqDecNumberComment,liloError skipwhite skipempty
52syn keyword liloDiskOpt sectors heads cylinders start nextgroup=liloEqDecNumber,liloEqDecNumberComment,liloError skipwhite skipempty
53
54" String
55syn keyword liloOption menu-title nextgroup=liloEqString,liloEqStringComment,liloError skipwhite skipempty
Bram Moolenaar5c736222010-01-06 20:54:52 +010056syn keyword liloKernelOpt append addappend nextgroup=liloEqString,liloEqStringComment,liloError skipwhite skipempty
Bram Moolenaar071d4272004-06-13 20:20:40 +000057syn keyword liloImageOpt fallback literal nextgroup=liloEqString,liloEqStringComment,liloError skipwhite skipempty
58
59" Hex number
Bram Moolenaar5eb86f92004-07-26 12:53:41 +000060syn keyword liloImageOpt map-drive to boot-as nextgroup=liloEqHexNumber,liloEqHexNumberComment,liloError skipwhite skipempty
Bram Moolenaar071d4272004-06-13 20:20:40 +000061syn keyword liloDiskOpt bios normal hidden nextgroup=liloEqNumber,liloEqNumberComment,liloError skipwhite skipempty
62
63" Number list
Bram Moolenaar5eb86f92004-07-26 12:53:41 +000064syn keyword liloOption bmp-colors nextgroup=liloEqNumberList,liloEqNumberListComment,liloError skipwhite skipempty
Bram Moolenaar071d4272004-06-13 20:20:40 +000065
66" Number list, some of the numbers followed by p
Bram Moolenaar5eb86f92004-07-26 12:53:41 +000067syn keyword liloOption bmp-table bmp-timer nextgroup=liloEqDecNumberPList,liloEqDecNumberPListComment,liloError skipwhite skipempty
Bram Moolenaar071d4272004-06-13 20:20:40 +000068
69" Flag
70syn keyword liloOption compact fix-table geometric ignore-table lba32 linear mandatory nowarn prompt
Bram Moolenaar5eb86f92004-07-26 12:53:41 +000071syn keyword liloOption bmp-retain el-torito-bootable-CD large-memory suppress-boot-time-BIOS-data
Bram Moolenaar071d4272004-06-13 20:20:40 +000072syn keyword liloKernelOpt read-only read-write
73syn keyword liloImageOpt bypass lock mandatory optional restricted single-key unsafe
Bram Moolenaar5eb86f92004-07-26 12:53:41 +000074syn keyword liloImageOpt master-boot wmwarn wmdisable
Bram Moolenaar071d4272004-06-13 20:20:40 +000075syn keyword liloDiskOpt change activate deactivate inaccessible reset
76
77" Image
78syn keyword liloImage image other nextgroup=liloEqPath,liloEqPathComment,liloError skipwhite skipempty
79syn keyword liloDisk disk nextgroup=liloEqPath,liloEqPathComment,liloError skipwhite skipempty
80syn keyword liloChRules change-rules
81
82" Vga keywords
83syn keyword liloVgaKeyword ask ext extended normal contained
84
85" Comment followed by equal sign and ...
86syn match liloEqPathComment "#.*$" contained nextgroup=liloEqPath,liloEqPathComment,liloError skipwhite skipempty
87syn match liloEqVgaComment "#.*$" contained nextgroup=liloEqVga,liloEqVgaComment,liloError skipwhite skipempty
88syn match liloEqNumberComment "#.*$" contained nextgroup=liloEqNumber,liloEqNumberComment,liloError skipwhite skipempty
89syn match liloEqDecNumberComment "#.*$" contained nextgroup=liloEqDecNumber,liloEqDecNumberComment,liloError skipwhite skipempty
90syn match liloEqHexNumberComment "#.*$" contained nextgroup=liloEqHexNumber,liloEqHexNumberComment,liloError skipwhite skipempty
91syn match liloEqStringComment "#.*$" contained nextgroup=liloEqString,liloEqStringComment,liloError skipwhite skipempty
Bram Moolenaar5eb86f92004-07-26 12:53:41 +000092syn match liloEqLabelStringComment "#.*$" contained nextgroup=liloEqLabelString,liloEqLabelStringComment,liloError skipwhite skipempty
Bram Moolenaar071d4272004-06-13 20:20:40 +000093syn match liloEqNumberListComment "#.*$" contained nextgroup=liloEqNumberList,liloEqNumberListComment,liloError skipwhite skipempty
94syn match liloEqDecNumberPListComment "#.*$" contained nextgroup=liloEqDecNumberPList,liloEqDecNumberPListComment,liloError skipwhite skipempty
95syn match liloEqAnythingComment "#.*$" contained nextgroup=liloEqAnything,liloEqAnythingComment,liloError skipwhite skipempty
96
97" Equal sign followed by ...
98syn match liloEqPath "=" contained nextgroup=liloPath,liloPathComment,liloError skipwhite skipempty
99syn match liloEqVga "=" contained nextgroup=liloVgaKeyword,liloHexNumber,liloDecNumber,liloVgaComment,liloError skipwhite skipempty
100syn match liloEqNumber "=" contained nextgroup=liloDecNumber,liloHexNumber,liloNumberComment,liloError skipwhite skipempty
101syn match liloEqDecNumber "=" contained nextgroup=liloDecNumber,liloDecNumberComment,liloError skipwhite skipempty
102syn match liloEqHexNumber "=" contained nextgroup=liloHexNumber,liloHexNumberComment,liloError skipwhite skipempty
103syn match liloEqString "=" contained nextgroup=liloString,liloStringComment,liloError skipwhite skipempty
Bram Moolenaar5eb86f92004-07-26 12:53:41 +0000104syn match liloEqLabelString "=" contained nextgroup=liloString,liloLabel,liloLabelStringComment,liloError skipwhite skipempty
Bram Moolenaar071d4272004-06-13 20:20:40 +0000105syn match liloEqNumberList "=" contained nextgroup=liloDecNumberList,liloDecNumberListComment,liloError skipwhite skipempty
106syn match liloEqDecNumberPList "=" contained nextgroup=liloDecNumberPList,liloDecNumberPListComment,liloError skipwhite skipempty
107syn match liloEqAnything "=" contained nextgroup=liloAnything,liloAnythingComment,liloError skipwhite skipempty
108
109" Comment followed by ...
110syn match liloPathComment "#.*$" contained nextgroup=liloPath,liloPathComment,liloError skipwhite skipempty
111syn match liloVgaComment "#.*$" contained nextgroup=liloVgaKeyword,liloHexNumber,liloVgaComment,liloError skipwhite skipempty
112syn match liloNumberComment "#.*$" contained nextgroup=liloDecNumber,liloHexNumber,liloNumberComment,liloError skipwhite skipempty
113syn match liloDecNumberComment "#.*$" contained nextgroup=liloDecNumber,liloDecNumberComment,liloError skipwhite skipempty
114syn match liloHexNumberComment "#.*$" contained nextgroup=liloHexNumber,liloHexNumberComment,liloError skipwhite skipempty
115syn match liloStringComment "#.*$" contained nextgroup=liloString,liloStringComment,liloError skipwhite skipempty
Bram Moolenaar5eb86f92004-07-26 12:53:41 +0000116syn match liloLabelStringComment "#.*$" contained nextgroup=liloString,liloLabel,liloLabelStringComment,liloError skipwhite skipempty
Bram Moolenaar071d4272004-06-13 20:20:40 +0000117syn match liloDecNumberListComment "#.*$" contained nextgroup=liloDecNumberList,liloDecNumberListComment,liloError skipwhite skipempty
118syn match liloDecNumberPListComment "#.*$" contained nextgroup=liloDecNumberPList,liloDecNumberPListComment,liloError skipwhite skipempty
119syn match liloAnythingComment "#.*$" contained nextgroup=liloAnything,liloAnythingComment,liloError skipwhite skipempty
120
121" Define the default highlighting
Bram Moolenaar89bcfda2016-08-30 23:26:57 +0200122command -nargs=+ HiLink hi def link <args>
Bram Moolenaar071d4272004-06-13 20:20:40 +0000123
Bram Moolenaar89bcfda2016-08-30 23:26:57 +0200124HiLink liloEqPath liloEquals
125HiLink liloEqWord liloEquals
126HiLink liloEqVga liloEquals
127HiLink liloEqDecNumber liloEquals
128HiLink liloEqHexNumber liloEquals
129HiLink liloEqNumber liloEquals
130HiLink liloEqString liloEquals
131HiLink liloEqAnything liloEquals
132HiLink liloEquals Special
Bram Moolenaar071d4272004-06-13 20:20:40 +0000133
Bram Moolenaar89bcfda2016-08-30 23:26:57 +0200134HiLink liloError Error
Bram Moolenaar071d4272004-06-13 20:20:40 +0000135
Bram Moolenaar89bcfda2016-08-30 23:26:57 +0200136HiLink liloEqPathComment liloComment
137HiLink liloEqVgaComment liloComment
138HiLink liloEqDecNumberComment liloComment
139HiLink liloEqHexNumberComment liloComment
140HiLink liloEqStringComment liloComment
141HiLink liloEqAnythingComment liloComment
142HiLink liloPathComment liloComment
143HiLink liloVgaComment liloComment
144HiLink liloDecNumberComment liloComment
145HiLink liloHexNumberComment liloComment
146HiLink liloNumberComment liloComment
147HiLink liloStringComment liloComment
148HiLink liloAnythingComment liloComment
149HiLink liloComment Comment
Bram Moolenaar071d4272004-06-13 20:20:40 +0000150
Bram Moolenaar89bcfda2016-08-30 23:26:57 +0200151HiLink liloDiskOpt liloOption
152HiLink liloKernelOpt liloOption
153HiLink liloImageOpt liloOption
154HiLink liloOption Keyword
Bram Moolenaar071d4272004-06-13 20:20:40 +0000155
Bram Moolenaar89bcfda2016-08-30 23:26:57 +0200156HiLink liloDecNumber liloNumber
157HiLink liloHexNumber liloNumber
158HiLink liloDecNumberP liloNumber
159HiLink liloNumber Number
160HiLink liloString String
161HiLink liloPath Constant
Bram Moolenaar071d4272004-06-13 20:20:40 +0000162
Bram Moolenaar89bcfda2016-08-30 23:26:57 +0200163HiLink liloSpecial Special
164HiLink liloLabel Title
165HiLink liloDecNumberList Special
166HiLink liloDecNumberPList Special
167HiLink liloAnything Normal
168HiLink liloEnviron Identifier
169HiLink liloVgaKeyword Identifier
170HiLink liloImage Type
171HiLink liloChRules Preproc
172HiLink liloDisk Preproc
Bram Moolenaar071d4272004-06-13 20:20:40 +0000173
Bram Moolenaar89bcfda2016-08-30 23:26:57 +0200174delcommand HiLink
Bram Moolenaar071d4272004-06-13 20:20:40 +0000175
176let b:current_syntax = "lilo"