lilo.vim 10 KB

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