Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1 | " Vim syntax file |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 2 | " Language: lilo configuration (lilo.conf) |
Bram Moolenaar | 5c73622 | 2010-01-06 20:54:52 +0100 | [diff] [blame] | 3 | " Maintainer: help wanted! |
| 4 | " Previous Maintainer: David Necas (Yeti) <yeti@physics.muni.cz> |
| 5 | " Last Change: 2009-01-27 |
Bram Moolenaar | 5eb86f9 | 2004-07-26 12:53:41 +0000 | [diff] [blame] | 6 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 7 | " Setup |
| 8 | if version >= 600 |
Bram Moolenaar | 5eb86f9 | 2004-07-26 12:53:41 +0000 | [diff] [blame] | 9 | if exists("b:current_syntax") |
| 10 | finish |
| 11 | endif |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 12 | else |
Bram Moolenaar | 5eb86f9 | 2004-07-26 12:53:41 +0000 | [diff] [blame] | 13 | syntax clear |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 14 | endif |
| 15 | |
| 16 | if version >= 600 |
Bram Moolenaar | 5eb86f9 | 2004-07-26 12:53:41 +0000 | [diff] [blame] | 17 | command -nargs=1 SetIsk setlocal iskeyword=<args> |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 18 | else |
Bram Moolenaar | 5eb86f9 | 2004-07-26 12:53:41 +0000 | [diff] [blame] | 19 | command -nargs=1 SetIsk set iskeyword=<args> |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 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 |
Bram Moolenaar | 5eb86f9 | 2004-07-26 12:53:41 +0000 | [diff] [blame] | 36 | syn match liloLabel :[^ "]\+: contained contains=liloSpecial,liloEnviron |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 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 |
Bram Moolenaar | 5eb86f9 | 2004-07-26 12:53:41 +0000 | [diff] [blame] | 43 | syn keyword liloOption backup bitmap boot disktab force-backup keytable map message nextgroup=liloEqPath,liloEqPathComment,liloError skipwhite skipempty |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 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 |
Bram Moolenaar | 5eb86f9 | 2004-07-26 12:53:41 +0000 | [diff] [blame] | 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 |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 52 | syn keyword liloKernelOpt ramdisk nextgroup=liloEqAnything,liloEqAnythingComment,liloError skipwhite skipempty |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 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 |
Bram Moolenaar | 5c73622 | 2010-01-06 20:54:52 +0100 | [diff] [blame] | 65 | syn keyword liloKernelOpt append addappend nextgroup=liloEqString,liloEqStringComment,liloError skipwhite skipempty |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 66 | syn keyword liloImageOpt fallback literal nextgroup=liloEqString,liloEqStringComment,liloError skipwhite skipempty |
| 67 | |
| 68 | " Hex number |
Bram Moolenaar | 5eb86f9 | 2004-07-26 12:53:41 +0000 | [diff] [blame] | 69 | syn keyword liloImageOpt map-drive to boot-as nextgroup=liloEqHexNumber,liloEqHexNumberComment,liloError skipwhite skipempty |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 70 | syn keyword liloDiskOpt bios normal hidden nextgroup=liloEqNumber,liloEqNumberComment,liloError skipwhite skipempty |
| 71 | |
| 72 | " Number list |
Bram Moolenaar | 5eb86f9 | 2004-07-26 12:53:41 +0000 | [diff] [blame] | 73 | syn keyword liloOption bmp-colors nextgroup=liloEqNumberList,liloEqNumberListComment,liloError skipwhite skipempty |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 74 | |
| 75 | " Number list, some of the numbers followed by p |
Bram Moolenaar | 5eb86f9 | 2004-07-26 12:53:41 +0000 | [diff] [blame] | 76 | syn keyword liloOption bmp-table bmp-timer nextgroup=liloEqDecNumberPList,liloEqDecNumberPListComment,liloError skipwhite skipempty |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 77 | |
| 78 | " Flag |
| 79 | syn keyword liloOption compact fix-table geometric ignore-table lba32 linear mandatory nowarn prompt |
Bram Moolenaar | 5eb86f9 | 2004-07-26 12:53:41 +0000 | [diff] [blame] | 80 | syn keyword liloOption bmp-retain el-torito-bootable-CD large-memory suppress-boot-time-BIOS-data |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 81 | syn keyword liloKernelOpt read-only read-write |
| 82 | syn keyword liloImageOpt bypass lock mandatory optional restricted single-key unsafe |
Bram Moolenaar | 5eb86f9 | 2004-07-26 12:53:41 +0000 | [diff] [blame] | 83 | syn keyword liloImageOpt master-boot wmwarn wmdisable |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 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 |
Bram Moolenaar | 5eb86f9 | 2004-07-26 12:53:41 +0000 | [diff] [blame] | 101 | syn match liloEqLabelStringComment "#.*$" contained nextgroup=liloEqLabelString,liloEqLabelStringComment,liloError skipwhite skipempty |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 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 |
Bram Moolenaar | 5eb86f9 | 2004-07-26 12:53:41 +0000 | [diff] [blame] | 113 | syn match liloEqLabelString "=" contained nextgroup=liloString,liloLabel,liloLabelStringComment,liloError skipwhite skipempty |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 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 |
Bram Moolenaar | 5eb86f9 | 2004-07-26 12:53:41 +0000 | [diff] [blame] | 125 | syn match liloLabelStringComment "#.*$" contained nextgroup=liloString,liloLabel,liloLabelStringComment,liloError skipwhite skipempty |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 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") |
Bram Moolenaar | 5eb86f9 | 2004-07-26 12:53:41 +0000 | [diff] [blame] | 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 |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 138 | |
Bram Moolenaar | 5eb86f9 | 2004-07-26 12:53:41 +0000 | [diff] [blame] | 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 |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 148 | |
Bram Moolenaar | 5eb86f9 | 2004-07-26 12:53:41 +0000 | [diff] [blame] | 149 | HiLink liloError Error |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 150 | |
Bram Moolenaar | 5eb86f9 | 2004-07-26 12:53:41 +0000 | [diff] [blame] | 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 |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 165 | |
Bram Moolenaar | 5eb86f9 | 2004-07-26 12:53:41 +0000 | [diff] [blame] | 166 | HiLink liloDiskOpt liloOption |
| 167 | HiLink liloKernelOpt liloOption |
| 168 | HiLink liloImageOpt liloOption |
| 169 | HiLink liloOption Keyword |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 170 | |
Bram Moolenaar | 5eb86f9 | 2004-07-26 12:53:41 +0000 | [diff] [blame] | 171 | HiLink liloDecNumber liloNumber |
| 172 | HiLink liloHexNumber liloNumber |
| 173 | HiLink liloDecNumberP liloNumber |
| 174 | HiLink liloNumber Number |
| 175 | HiLink liloString String |
| 176 | HiLink liloPath Constant |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 177 | |
Bram Moolenaar | 5eb86f9 | 2004-07-26 12:53:41 +0000 | [diff] [blame] | 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 |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 188 | |
Bram Moolenaar | 5eb86f9 | 2004-07-26 12:53:41 +0000 | [diff] [blame] | 189 | delcommand HiLink |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 190 | endif |
| 191 | |
| 192 | let b:current_syntax = "lilo" |