2 " Language: lilo configuration (lilo.conf)
3 " Maintainer: David Ne\v{c}as (Yeti) <yeti@physics.muni.cz>
4 " Last Change: 2001-04-26
5 " URI: http://physics.muni.cz/~yeti/download/lilo.vim
7 " Notes: Slightly overengineered now; deny-all based: virtually everything is
8 " an error and only what is recognized is higlighted otherwise
9 " TODO: add `display' where appropriate
12 " React to possibly already-defined syntax.
13 " For version 5.x: Clear all syntax items unconditionally
14 " For version 6.x: Quit when a syntax file was already loaded
16 if exists("b:current_syntax")
23 " Set iskeyword since we need `-' (and potentially others) in keywords.
24 " For version 5.x: Set it globally
25 " For version 6.x: Set it locally
27 command -nargs=1 SetIsk setlocal iskeyword=<args>
29 command -nargs=1 SetIsk set iskeyword=<args>
37 syn match liloError "\S\+"
38 syn match liloComment "#.*$"
39 syn match liloEnviron "\$\w\+" contained
40 syn match liloEnviron "\${[^}]\+}" contained
41 syn match liloDecNumber "-\=\d\+" contained
42 syn match liloHexNumber "0[xX]\x\+" contained
43 syn match liloSpecial contained "\\\(\"\|\\\|$\)"
44 syn region liloString start=+"+ skip=+\\\\\|\\"+ end=+"+ contained contains=liloSpecial,liloEnviron
45 syn region liloPath start=+/+ skip=+\\\\\|\\ \|\\$"+ end=+ \|$+ contained contains=liloSpecial,liloEnviron
46 syn region liloAnything start=+[^[:space:]#]+ skip=+\\\\\|\\ \|\\$+ end=+ \|$+ contained contains=liloSpecial,liloEnviron,liloString
49 syn keyword liloOption backup boot force-backup install keytable map message nextgroup=liloEqPath,liloEqPathComment,liloError skipwhite skipempty
50 syn keyword liloKernelOpt initrd root nextgroup=liloEqPath,liloEqPathComment,liloError skipwhite skipempty
51 syn keyword liloImageOpt path loader nextgroup=liloEqPath,liloEqPathComment,liloError skipwhite skipempty
52 syn keyword liloDiskOpt partition nextgroup=liloEqPath,liloEqPathComment,liloError skipwhite skipempty
55 syn keyword liloOption default serial nextgroup=liloEqAnything,liloEqAnythingComment,liloError skipwhite skipempty
56 syn keyword liloKernelOpt ramdisk nextgroup=liloEqAnything,liloEqAnythingComment,liloError skipwhite skipempty
57 syn keyword liloImageOpt alias label password range nextgroup=liloEqAnything,liloEqAnythingComment,liloError skipwhite skipempty
58 syn keyword liloDiskOpt set nextgroup=liloEqAnything,liloEqAnythingComment,liloError skipwhite skipempty
61 syn keyword liloKernelOpt vga nextgroup=liloEqVga,liloEqVgaComment,liloError skipwhite skipempty
64 syn keyword liloOption delay timeout verbose nextgroup=liloEqDecNumber,liloEqDecNumberComment,liloError skipwhite skipempty
65 syn keyword liloDiskOpt sectors heads cylinders start nextgroup=liloEqDecNumber,liloEqDecNumberComment,liloError skipwhite skipempty
68 syn keyword liloKernelOpt append nextgroup=liloEqString,liloEqStringComment,liloError skipwhite skipempty
69 syn keyword liloImageOpt fallback literal nextgroup=liloEqString,liloEqStringComment,liloError skipwhite skipempty
72 syn keyword liloImageOpt map-drive to nextgroup=liloEqHexNumber,liloEqHexNumberComment,liloError skipwhite skipempty
73 syn keyword liloDiskOpt bios normal hidden nextgroup=liloEqHexNumber,liloEqHexNumberComment,liloError skipwhite skipempty
76 syn keyword liloOption compact fix-table ignore-table linear nowarn prompt
77 syn keyword liloKernelOpt read-only read-write
78 syn keyword liloImageOpt lock optional restricted single-key unsafe
79 syn keyword liloDiskOpt change activate deactivate inaccessible reset
82 syn keyword liloImage image other nextgroup=liloEqPath,liloEqPathComment,liloError skipwhite skipempty
83 syn keyword liloDisk disk nextgroup=liloEqPath,liloEqPathComment,liloError skipwhite skipempty
84 syn keyword liloChRules change-rules
87 syn keyword liloVgaKeyword ask ext extended normal contained
89 " Comment followed by equal sign and ... {{{
90 syn match liloEqPathComment "#.*$" contained nextgroup=liloEqPath,liloEqPathComment,liloError skipwhite skipempty
91 syn match liloEqVgaComment "#.*$" contained nextgroup=liloEqVga,liloEqVgaComment,liloError skipwhite skipempty
92 syn match liloEqDecNumberComment "#.*$" contained nextgroup=liloEqDecNumber,liloEqDecNumberComment,liloError skipwhite skipempty
93 syn match liloEqHexNumberComment "#.*$" contained nextgroup=liloEqHexNumber,liloEqHexNumberComment,liloError skipwhite skipempty
94 syn match liloEqStringComment "#.*$" contained nextgroup=liloEqString,liloEqStringComment,liloError skipwhite skipempty
95 syn match liloEqAnythingComment "#.*$" contained nextgroup=liloEqAnything,liloEqAnythingComment,liloError skipwhite skipempty
97 " Equal sign followed by ... {{{
98 syn match liloEqPath "=" contained nextgroup=liloPath,liloPathComment,liloError skipwhite skipempty
99 syn match liloEqVga "=" contained nextgroup=liloVgaKeyword,liloHexNumber,liloDecNumber,liloVgaComment,liloError skipwhite skipempty
100 syn match liloEqDecNumber "=" contained nextgroup=liloDecNumber,liloDecNumberComment,liloError skipwhite skipempty
101 syn match liloEqHexNumber "=" contained nextgroup=liloHexNumber,liloHexNumberComment,liloError skipwhite skipempty
102 syn match liloEqString "=" contained nextgroup=liloString,liloStringComment,liloError skipwhite skipempty
103 syn match liloEqAnything "=" contained nextgroup=liloAnything,liloAnythingComment,liloError skipwhite skipempty
105 " Comment followed by ... {{{
106 syn match liloPathComment "#.*$" contained nextgroup=liloPath,liloPathComment,liloError skipwhite skipempty
107 syn match liloVgaComment "#.*$" contained nextgroup=liloVgaKeyword,liloHexNumber,liloVgaComment,liloError skipwhite skipempty
108 syn match liloDecNumberComment "#.*$" contained nextgroup=liloDecNumber,liloDecNumberComment,liloError skipwhite skipempty
109 syn match liloHexNumberComment "#.*$" contained nextgroup=liloHexNumber,liloHexNumberComment,liloError skipwhite skipempty
110 syn match liloStringComment "#.*$" contained nextgroup=liloString,liloStringComment,liloError skipwhite skipempty
111 syn match liloAnythingComment "#.*$" contained nextgroup=liloAnything,liloAnythingComment,liloError skipwhite skipempty
113 " Define the default highlighting {{{
114 " For version 5.7 and earlier: Only when not done already
115 " For version 5.8 and later: Only when an item doesn't have highlighting yet
116 if version >= 508 || !exists("did_lilo_syntax_inits")
118 let did_lilo_syntax_inits = 1
119 command -nargs=+ HiLink hi link <args>
121 command -nargs=+ HiLink hi def link <args>
124 HiLink liloEqPath liloEquals
125 HiLink liloEqWord liloEquals
126 HiLink liloEqVga liloEquals
127 HiLink liloEqDecNumber liloEquals
128 HiLink liloEqHexNumber liloEquals
129 HiLink liloEqString liloEquals
130 HiLink liloEqAnything liloEquals
131 HiLink liloEquals Special
133 HiLink liloError Error
135 HiLink liloEqPathComment liloComment
136 HiLink liloEqVgaComment liloComment
137 HiLink liloEqDecNumberComment liloComment
138 HiLink liloEqHexNumberComment liloComment
139 HiLink liloEqStringComment liloComment
140 HiLink liloEqAnythingComment liloComment
141 HiLink liloPathComment liloComment
142 HiLink liloVgaComment liloComment
143 HiLink liloDecNumberComment liloComment
144 HiLink liloHexNumberComment liloComment
145 HiLink liloStringComment liloComment
146 HiLink liloAnythingComment liloComment
147 HiLink liloComment Comment
149 HiLink liloDiskOpt liloOption
150 HiLink liloKernelOpt liloOption
151 HiLink liloImageOpt liloOption
152 HiLink liloOption Keyword
154 HiLink liloDecNumber liloNumber
155 HiLink liloHexNumber liloNumber
156 HiLink liloNumber Number
157 HiLink liloString String
158 HiLink liloPath Constant
160 HiLink liloSpecial Special
161 HiLink liloAnything Normal
162 HiLink liloEnviron Identifier
163 HiLink liloVgaKeyword Identifier
164 HiLink liloImage Type
165 HiLink liloChRules Preproc
166 HiLink liloDisk Preproc
171 let b:current_syntax = "lilo"