aptconf.vim 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575
  1. " Vim syntax file
  2. " Language: APT config file
  3. " Maintainer: Yann Amar <quidame@poivron.org>
  4. " Last Change: 2015 Dec 22
  5. " quit when a syntax file was already loaded
  6. if !exists("main_syntax")
  7. if exists("b:current_syntax")
  8. finish
  9. endif
  10. let main_syntax = 'aptconf'
  11. endif
  12. let s:cpo_save = &cpo
  13. set cpo&vim
  14. " Errors:
  15. " Catch all that is not overridden by next rules/items:
  16. syn match aptconfError display '[^[:blank:]]'
  17. syn match aptconfError display '^[^[:blank:]][^:{]*'
  18. " Options:
  19. " Define a general regular expression for the options that are not defined
  20. " later as keywords. Following apt.conf(5), we know that options are case
  21. " insensitive, and can contain alphanumeric characters and '/-:._+'; we
  22. " assume that there can not be consecutive colons (::) which is used as
  23. " syntax operator; we also assume that an option name can not start or end
  24. " by a colon.
  25. syn case ignore
  26. syn match aptconfRegexpOpt '[-[:alnum:]/.+_]\+\(:[-[:alnum:]/.+_]\+\)*' contained display
  27. " Keywords:
  28. setlocal iskeyword+=/,-,.,_,+
  29. "setlocal iskeyword+=: is problematic, because of the '::' separator
  30. " Incomplete keywords will be treated differently than completely bad strings:
  31. syn keyword aptconfGroupIncomplete
  32. \ a[cquire] a[dequate] a[ptitude] a[ptlistbugs] d[ebtags] d[ebug]
  33. \ d[ir] d[pkg] d[select] o[rderlist] p[ackagemanager] p[kgcachegen]
  34. \ q[uiet] r[pm] s[ynaptic] u[nattended-upgrade] w[hatmaps]
  35. " Only the following keywords can be used at toplevel (to begin an option):
  36. syn keyword aptconfGroup
  37. \ acquire adequate apt aptitude aptlistbugs debtags debug
  38. \ dir dpkg dselect orderlist packagemanager pkgcachegen
  39. \ quiet rpm synaptic unattended-upgrade whatmaps
  40. " Possible options for each group:
  41. " Acquire: {{{
  42. syn keyword aptconfAcquire contained
  43. \ cdrom Check-Valid-Until CompressionTypes ForceHash ForceIPv4
  44. \ ForceIPv6 ftp gpgv GzipIndexes http https Languages Max-ValidTime
  45. \ Min-ValidTime PDiffs Queue-Mode Retries Source-Symlinks
  46. syn keyword aptconfAcquireCDROM contained
  47. \ AutoDetect CdromOnly Mount UMount
  48. syn keyword aptconfAcquireCompressionTypes contained
  49. \ bz2 lzma gz Order
  50. syn keyword aptconfAcquireFTP contained
  51. \ ForceExtended Passive Proxy ProxyLogin Timeout
  52. syn keyword aptconfAcquireHTTP contained
  53. \ AllowRedirect Dl-Limit Max-Age No-Cache No-Store Pipeline-Depth
  54. \ Proxy ProxyAutoDetect Proxy-Auto-Detect Timeout User-Agent
  55. syn keyword aptconfAcquireHTTPS contained
  56. \ AllowRedirect CaInfo CaPath CrlFile Dl-Limit IssuerCert Max-Age
  57. \ No-Cache No-Store Proxy SslCert SslForceVersion SslKey Timeout
  58. \ Verify-Host Verify-Peer
  59. syn keyword aptconfAcquireMaxValidTime contained
  60. \ Debian Debian-Security
  61. syn keyword aptconfAcquirePDiffs contained
  62. \ FileLimit SizeLimit
  63. syn cluster aptconfAcquire_ contains=aptconfAcquire,
  64. \ aptconfAcquireCDROM,aptconfAcquireCompressionTypes,aptconfAcquireFTP,
  65. \ aptconfAcquireHTTP,aptconfAcquireHTTPS,aptconfAcquireMaxValidTime,
  66. \ aptconfAcquirePDiffs
  67. " }}}
  68. " Adequate: {{{
  69. syn keyword aptconfAdequate contained
  70. \ Enabled
  71. syn cluster aptconfAdequate_ contains=aptconfAdequate
  72. " }}}
  73. " Apt: {{{
  74. syn keyword aptconfApt contained
  75. \ Architecture Architectures Archive Authentication AutoRemove
  76. \ Build-Essential Build-Profiles Cache Cache-Grow Cache-Limit
  77. \ Cache-Start CDROM Changelogs Clean-Installed Compressor
  78. \ Default-Release Force-LoopBreak Get Ignore-Hold Immediate-Configure
  79. \ Install-Recommends Install-Suggests Keep-Fds List-Cleanup
  80. \ Move-Autobit-Sections NeverAutoRemove Never-MarkAuto-Sections
  81. \ Periodic Status-Fd Update VersionedKernelPackages
  82. syn keyword aptconfAptAuthentication contained
  83. \ TrustCDROM
  84. syn keyword aptconfAptAutoRemove contained
  85. \ RecommendsImportant SuggestsImportant
  86. syn keyword aptconfAptCache contained
  87. \ AllNames AllVersions Generate GivenOnly Important Installed NamesOnly
  88. \ RecurseDepends ShowFull
  89. syn keyword aptconfAptCDROM contained
  90. \ Fast NoAct NoMount Rename
  91. syn keyword aptconfAptChangelogs contained
  92. \ Server
  93. syn keyword aptconfAptCompressor contained
  94. \ bzip2 gzip lzma xz
  95. syn keyword aptconfAptCompressorAll contained
  96. \ Binary CompressArg Cost Extension Name UncompressArg
  97. syn keyword aptconfAptGet contained
  98. \ AllowUnauthenticated Arch-Only Assume-No Assume-Yes AutomaticRemove
  99. \ Build-Dep-Automatic Compile Diff-Only Download Download-Only Dsc-Only
  100. \ Fix-Broken Fix-Missing Force-Yes HideAutoRemove Host-Architecture
  101. \ List-Cleanup Only-Source Print-URIs Purge ReInstall Remove
  102. \ Show-Upgraded Show-User-Simulation-Note Show-Versions Simulate
  103. \ Tar-Only Trivial-Only Upgrade
  104. syn keyword aptconfAptPeriodic contained
  105. \ AutocleanInterval BackupArchiveInterval BackupLevel
  106. \ Download-Upgradeable-Packages Download-Upgradeable-Packages-Debdelta
  107. \ Enable MaxAge MaxSize MinAge Unattended-Upgrade Update-Package-Lists
  108. \ Verbose
  109. syn keyword aptconfAptUpdate contained
  110. \ List-Refresh Pre-Invoke Post-Invoke Post-Invoke-Success
  111. syn cluster aptconfApt_ contains=aptconfApt,
  112. \ aptconfAptAuthentication,aptconfAptAutoRemove,aptconfAptCache,
  113. \ aptconfAptCDROM,aptconfAptChangelogs,aptconfAptCompressor,
  114. \ aptconfAptCompressorAll,aptconfAptGet,aptconfAptPeriodic,
  115. \ aptconfAptUpdate
  116. " }}}
  117. " Aptitude: {{{
  118. syn keyword aptconfAptitude contained
  119. \ Allow-Null-Upgrade Always-Use-Safe-Resolver Autoclean-After-Update
  120. \ Auto-Install Auto-Fix-Broken Cmdline Debtags-Binary
  121. \ Debtags-Update-Options Delete-Unused Delete-Unused-Pattern
  122. \ Display-Planned-Action Forget-New-On-Install Forget-New-On-Update
  123. \ Get-Root-Command Ignore-Old-Tmp Ignore-Recommends-Important
  124. \ Keep-Recommends Keep-Suggests Keep-Unused-Pattern LockFile Log
  125. \ Logging Parse-Description-Bullets Pkg-Display-Limit ProblemResolver
  126. \ Purge-Unused Recommends-Important Safe-Resolver Screenshot Sections
  127. \ Simulate Spin-Interval Suggests-Important Suppress-Read-Only-Warning
  128. \ Theme Track-Dselect-State UI Warn-Not-Root
  129. syn keyword aptconfAptitudeCmdline contained
  130. \ Always-Prompt Assume-Yes Disable-Columns Download-Only Fix-Broken
  131. \ Ignore-Trust-Violations Package-Display-Format Package-Display-Width
  132. \ Progress Request-Strictness Resolver-Debug Resolver-Dump
  133. \ Resolver-Show-Steps Safe-Upgrade Show-Deps Show-Size-Changes
  134. \ Show-Versions Show-Why Simulate Verbose Version-Display-Format
  135. \ Versions-Group-By Versions-Show-Package-Names Visual-Preview
  136. \ Why-Display-Mode
  137. syn keyword aptconfAptitudeCmdlineProgress contained
  138. \ Percent-On-Right Retain-Completed
  139. syn keyword aptconfAptitudeCmdlineSafeUpgrade contained
  140. \ No-New-Installs
  141. syn keyword aptconfAptitudeLogging contained
  142. \ File Levels
  143. syn keyword aptconfAptitudeProblemResolver contained
  144. \ Allow-Break-Holds BreakHoldScore Break-Hold-Level BrokenScore
  145. \ DefaultResolutionScore Discard-Null-Solution
  146. \ EssentialRemoveScore ExtraScore FullReplacementScore FutureHorizon
  147. \ Hints ImportantScore Infinity InstallScore Keep-All-Level KeepScore
  148. \ NonDefaultScore Non-Default-Level OptionalScore PreserveAutoScore
  149. \ PreserveManualScore RemoveScore Remove-Essential-Level Remove-Level
  150. \ RequiredScore ResolutionScore Safe-Level SolutionCost StandardScore
  151. \ StepLimit StepScore Trace-Directory Trace-File
  152. \ UndoFullReplacementScore UnfixedSoftScore UpgradeScore
  153. syn keyword aptconfAptitudeSafeResolver contained
  154. \ No-New-Installs No-New-Upgrades Show-Resolver-Actions
  155. syn keyword aptconfAptitudeScreenshot contained
  156. \ Cache-Max IncrementalLoadLimit
  157. syn keyword aptconfAptitudeSections contained
  158. \ Descriptions Top-Sections
  159. syn keyword aptconfAptitudeUI contained
  160. \ Advance-On-Action Auto-Show-Reasons Default-Grouping
  161. \ Default-Package-View Default-Preview-Grouping Default-Sorting
  162. \ Description-Visible-By-Default Exit-On-Last-Close Fill-Text
  163. \ Flat-View-As-First-View HelpBar Incremental-Search InfoAreaTabs
  164. \ KeyBindings MenuBar-Autohide Minibuf-Download-Bar Minibuf-Prompts
  165. \ New-package-Commands Package-Display-Format Package-Header-Format
  166. \ Package-Status-Format Pause-After-Download Preview-Limit
  167. \ Prompt-On-Exit Styles ViewTabs
  168. syn keyword aptconfAptitudeUIKeyBindings contained
  169. \ ApplySolution Begin BugReport Cancel Changelog ChangePkgTreeGrouping
  170. \ ChangePkgTreeLimit ChangePkgTreeSorting ClearAuto CollapseAll
  171. \ CollapseTree Commit Confirm Cycle CycleNext CycleOrder CyclePrev
  172. \ DelBOL DelBack DelEOL DelForward Dependencies DescriptionCycle
  173. \ DescriptionDown DescriptionUp DoInstallRun Down DpkgReconfigure
  174. \ DumpResolver EditHier End ExamineSolution ExpandAll ExpandTree
  175. \ FirstSolution ForbidUpgrade ForgetNewPackages Help HistoryNext
  176. \ HistoryPrev Hold Install InstallSingle Keep LastSolution Left
  177. \ LevelDown LevelUp MarkUpgradable MineFlagSquare MineLoadGame
  178. \ MineSaveGame MineSweepSquare MineUncoverSquare MineUncoverSweepSquare
  179. \ NextPage NextSolution No Parent PrevPage PrevSolution Purge
  180. \ PushButton Quit QuitProgram RejectBreakHolds Refresh Remove
  181. \ ReInstall RepeatSearchBack ReSearch ReverseDependencies Right
  182. \ SaveHier Search SearchBack SearchBroken SetAuto ShowHideDescription
  183. \ SolutionActionApprove SolutionActionReject ToggleExpanded
  184. \ ToggleMenuActive Undo Up UpdatePackageList Versions Yes
  185. syn keyword aptconfAptitudeUIStyles contained
  186. \ Bullet ChangeLogNewerVersion Default DepBroken DisabledMenuEntry
  187. \ DownloadHit DownloadProgress EditLine Error Header HighlightedMenuBar
  188. \ HighlightedMenuEntry MediaChange MenuBar MenuBorder MenuEntry
  189. \ MineBomb MineBorder MineFlag MineNumber1 MineNumber2 MineNumber3
  190. \ MineNumber4 MineNumber5 MineNumber6 MineNumber7 MineNumber8
  191. \ MultiplexTab MultiplexTabHighlighted PkgBroken PkgBrokenHighlighted
  192. \ PkgIsInstalled PkgIsInstalledHighlighted PkgNotInstalled
  193. \ PkgNotInstalledHighlighted PkgToDowngrade PkgToDowngradeHighlighted
  194. \ PkgToHold PkgToHoldHighlighted PkgToInstall PkgToInstallHighlighted
  195. \ PkgToRemove PkgToRemoveHighlighted PkgToUpgrade
  196. \ PkgToUpgradeHighlighted Progress SolutionActionApproved
  197. \ SolutionActionRejected Status TreeBackground TrustWarning
  198. syn keyword aptconfAptitudeUIStylesElements contained
  199. \ bg clear fg flip set
  200. syn cluster aptconfAptitude_ contains=aptconfAptitude,
  201. \ aptconfAptitudeCmdline,aptconfAptitudeCmdlineProgress,
  202. \ aptconfAptitudeCmdlineSafeUpgrade,aptconfAptitudeLogging,
  203. \ aptconfAptitudeProblemResolver,aptconfAptitudeSafeResolver,
  204. \ aptconfAptitudeScreenshot,aptconfAptitudeSections,aptconfAptitudeUI,
  205. \ aptconfAptitudeUIKeyBindings,aptconfAptitudeUIStyles,
  206. \ aptconfAptitudeUIStylesElements
  207. " }}}
  208. " AptListbugs: {{{
  209. syn keyword aptconfAptListbugs contained
  210. \ IgnoreRegexp Severities
  211. syn cluster aptconfAptListbugs_ contains=aptconfAptListbugs
  212. " }}}
  213. " DebTags: {{{
  214. syn keyword aptconfDebTags contained
  215. \ Vocabulary
  216. syn cluster aptconfDebTags_ contains=aptconfDebTags
  217. " }}}
  218. " Debug: {{{
  219. syn keyword aptconfDebug contained
  220. \ Acquire aptcdrom BuildDeps Hashes IdentCdrom Nolocking
  221. \ pkgAcquire pkgAutoRemove pkgCacheGen pkgDepCache pkgDPkgPM
  222. \ pkgDPkgProgressReporting pkgInitialize pkgOrderList
  223. \ pkgPackageManager pkgPolicy pkgProblemResolver RunScripts
  224. \ sourceList
  225. syn keyword aptconfDebugAcquire contained
  226. \ cdrom Ftp gpgv Http Https netrc
  227. syn keyword aptconfDebugPkgAcquire contained
  228. \ Auth Diffs RRed Worker
  229. syn keyword aptconfDebugPkgDepCache contained
  230. \ AutoInstall Marker
  231. syn keyword aptconfDebugPkgProblemResolver contained
  232. \ ShowScores
  233. syn cluster aptconfDebug_ contains=aptconfDebug,
  234. \ aptconfDebugAcquire,aptconfDebugPkgAcquire,aptconfDebugPkgDepCache,
  235. \ aptconfDebugPkgProblemResolver
  236. " }}}
  237. " Dir: {{{
  238. syn keyword aptconfDir contained
  239. \ Aptitude Bin Cache Etc Ignore-Files-Silently Log Media Parts RootDir
  240. \ State
  241. syn keyword aptconfDirAptitude contained
  242. \ state
  243. syn keyword aptconfDirBin contained
  244. \ apt-get apt-cache dpkg dpkg-buildpackage dpkg-source gpg gzip Methods
  245. \ solvers
  246. syn keyword aptconfDirCache contained
  247. \ Archives Backup pkgcache srcpkgcache
  248. syn keyword aptconfDirEtc contained
  249. \ Main Netrc Parts Preferences PreferencesParts SourceList SourceParts
  250. \ VendorList VendorParts Trusted TrustedParts
  251. syn keyword aptconfDirLog contained
  252. \ History Terminal
  253. syn keyword aptconfDirMedia contained
  254. \ MountPath
  255. syn keyword aptconfDirState contained
  256. \ cdroms extended_states Lists mirrors preferences status
  257. syn cluster aptconfDir_ contains=aptconfDir,
  258. \ aptconfDirAptitude,aptconfDirBin,aptconfDirCache,aptconfDirEtc,
  259. \ aptconfDirLog,aptconfDirMedia,aptconfDirState
  260. " }}}
  261. " DPkg: {{{
  262. syn keyword aptconfDPkg contained
  263. \ Build-Options Chroot-Directory ConfigurePending FlushSTDIN
  264. \ MaxArgBytes MaxArgs MaxBytes NoTriggers options
  265. \ Pre-Install-Pkgs Pre-Invoke Post-Invoke
  266. \ Run-Directory StopOnError Tools TriggersPending
  267. syn keyword aptconfDPkgTools contained
  268. \ adequate InfoFD Options Version
  269. syn cluster aptconfDPkg_ contains=aptconfDPkg,
  270. \ aptconfDPkgTools
  271. " }}}
  272. " DSelect: {{{
  273. syn keyword aptconfDSelect contained
  274. \ CheckDir Clean Options PromptAfterUpdate UpdateOptions
  275. syn cluster aptconfDSelect_ contains=aptconfDSelect
  276. " }}}
  277. " OrderList: {{{
  278. syn keyword aptconfOrderList contained
  279. \ Score
  280. syn keyword aptconfOrderListScore contained
  281. \ Delete Essential Immediate PreDepends
  282. syn cluster aptconfOrderList_ contains=aptconfOrderList,
  283. \ aptconfOrderListScore
  284. " }}}
  285. " PackageManager: {{{
  286. syn keyword aptconfPackageManager contained
  287. \ Configure
  288. syn cluster aptconfPackageManager_ contains=aptconfPackageManager
  289. " }}}
  290. " PkgCacheGen: {{{
  291. syn keyword aptconfPkgCacheGen contained
  292. \ Essential
  293. syn cluster aptconfPkgCacheGen_ contains=aptconfPkgCacheGen
  294. " }}}
  295. " Quiet: {{{
  296. syn keyword aptconfQuiet contained
  297. \ NoUpdate
  298. syn cluster aptconfQuiet_ contains=aptconfQuiet
  299. " }}}
  300. " Rpm: {{{
  301. syn keyword aptconfRpm contained
  302. \ Post-Invoke Pre-Invoke
  303. syn cluster aptconfRpm_ contains=aptconfRpm
  304. " }}}
  305. " Synaptic: {{{
  306. syn keyword aptconfSynaptic contained
  307. \ AskQuitOnProceed AskRelated AutoCleanCache CleanCache DefaultDistro
  308. \ delAction delHistory Download-Only ftpProxy ftpProxyPort httpProxy
  309. \ httpProxyPort Install-Recommends LastSearchType Maximized noProxy
  310. \ OneClickOnStatusActions ShowAllPkgInfoInMain showWelcomeDialog
  311. \ ToolbarState undoStackSize update upgradeType useProxy UseStatusColors
  312. \ UseTerminal useUserFont useUserTerminalFont ViewMode
  313. \ availVerColumnPos availVerColumnVisible componentColumnPos
  314. \ componentColumnVisible descrColumnPos descrColumnVisible
  315. \ downloadSizeColumnPos downloadSizeColumnVisible hpanedPos
  316. \ instVerColumnPos instVerColumnVisible instSizeColumnPos
  317. \ instSizeColumnVisible nameColumnPos nameColumnVisible
  318. \ sectionColumnPos sectionColumnVisible statusColumnPos
  319. \ statusColumnVisible supportedColumnPos supportedColumnVisible
  320. \ vpanedPos windowWidth windowHeight windowX windowY closeZvt
  321. \ color-available color-available-locked color-broken color-downgrade
  322. \ color-install color-installed-locked color-installed-outdated
  323. \ color-installed-updated color-new color-purge color-reinstall
  324. \ color-remove color-upgrade
  325. syn keyword aptconfSynapticUpdate contained
  326. \ last type
  327. syn cluster aptconfSynaptic_ contains=aptconfSynaptic,
  328. \ aptconfSynapticUpdate
  329. " }}}
  330. " Unattended Upgrade: {{{
  331. syn keyword aptconfUnattendedUpgrade contained
  332. \ AutoFixInterruptedDpkg Automatic-Reboot Automatic-Reboot-Time
  333. \ Automatic-Reboot-WithUsers InstallOnShutdown Mail MailOnlyOnError
  334. \ MinimalSteps Origins-Pattern Package-Blacklist
  335. \ Remove-Unused-Dependencies
  336. syn cluster aptconfUnattendedUpgrade_ contains=aptconfUnattendedUpgrade
  337. " }}}
  338. " Whatmaps: {{{
  339. syn keyword aptconfWhatmaps contained
  340. \ Enable-Restart Security-Update-Origins
  341. syn cluster aptconfWhatmaps_ contains=aptconfWhatmaps
  342. " }}}
  343. syn case match
  344. " Now put all the keywords (and 'valid' options) in a single cluster:
  345. syn cluster aptconfOptions contains=aptconfRegexpOpt,
  346. \ @aptconfAcquire_,@aptconfAdequate_,@aptconfApt_,@aptconfAptitude_,
  347. \ @aptconfAptListbugs_,@aptconfDebTags_,@aptconfDebug_,@aptconfDir_,
  348. \ @aptconfDPkg_,@aptconfDSelect_,@aptconfOrderList_,
  349. \ @aptconfPackageManager_,@aptconfPkgCacheGen_,@aptconfQuiet_,
  350. \ @aptconfRpm_,@aptconfSynaptic_,@aptconfUnattendedUpgrade_,
  351. \ @aptconfWhatmaps_
  352. " Syntax:
  353. syn match aptconfSemiColon ';'
  354. syn match aptconfDoubleColon '::'
  355. syn match aptconfCurlyBraces '[{}]'
  356. syn region aptconfValue start='"' end='"' oneline display
  357. syn region aptconfInclude matchgroup=aptconfOperator start='{' end='}' contains=ALLBUT,aptconfGroup,aptconfGroupIncomplete,@aptconfCommentSpecial
  358. syn region aptconfInclude matchgroup=aptconfOperator start='::' end='{'me=s-1 contains=@aptconfOptions,aptconfError display
  359. syn region aptconfInclude matchgroup=aptconfOperator start='::' end='::\|\s'me=s-1 oneline contains=@aptconfOptions,aptconfError display
  360. " Basic Syntax Errors: XXX avoid to generate false positives !!!
  361. "
  362. " * Undocumented inline comment. Since it is currently largely used, and does
  363. " not seem to cause trouble ('apt-config dump' never complains when # is used
  364. " the same way than //) it has been moved to aptconfComment group. But it
  365. " still needs to be defined here (i.e. before #clear and #include directives)
  366. syn match aptconfComment '#.*' contains=@aptconfCommentSpecial
  367. "
  368. " * When a semicolon is missing after a double-quoted string:
  369. " There are some cases (for example in the Dir group of options, but not only)
  370. " where this syntax is valid. So we don't treat it as a strict error.
  371. syn match aptconfAsError display '"[^"]*"[^;]'me=e-1
  372. syn match aptconfAsError display '"[^"]*"$'
  373. "
  374. " * When double quotes are missing around a value (before a semicolon):
  375. " This omission has no effect if the value is a single string (without blank
  376. " characters). But apt.conf(5) says that quotes are required, and this item
  377. " avoids to match unquoted keywords.
  378. syn match aptconfAsError display '\s[^"[:blank:]]*[^}"];'me=e-1
  379. "
  380. " * When only one double quote is missing around a value (before a semicolon):
  381. " No comment for that: it must be highly visible.
  382. syn match aptconfError display '\(\s\|;\)"[^"[:blank:]]\+;'me=e-1
  383. syn match aptconfError display '\(\s\|;\)[^"[:blank:]]\+";'me=e-1
  384. "
  385. " * When space is missing between option and (quoted) value:
  386. " TODO (partially implemented)
  387. syn match aptconfError display '::[^[:blank:]]*"'
  388. " Special Actions:
  389. syn match aptconfAction '^#\(clear\|include\)\>'
  390. syn region aptconfAction matchgroup=aptconfAction start='^#clear\>' end=';'me=s-1 oneline contains=aptconfGroup,aptconfDoubleColon,@aptconfOptions
  391. syn region aptconfAction matchgroup=aptconfAction start='^#include\>' end=';'me=s-1 oneline contains=aptconfRegexpOpt
  392. " Comments:
  393. syn keyword aptconfTodo TODO FIXME NOTE XXX contained
  394. syn cluster aptconfCommentSpecial contains=@Spell,aptconfTodo
  395. syn match aptconfComment '//.*' contains=@aptconfCommentSpecial
  396. syn region aptconfComment start='/\*' end='\*/' contains=@aptconfCommentSpecial
  397. " Highlight Definitions:
  398. hi def link aptconfTodo Todo
  399. hi def link aptconfError Error
  400. hi def link aptconfComment Comment
  401. hi def link aptconfOperator Operator
  402. hi def link aptconfAction PreProc
  403. hi def link aptconfOption Type
  404. hi def link aptconfValue String
  405. hi def link aptconfRegexpOpt Normal
  406. hi def link aptconfAsError Special
  407. hi def link aptconfSemiColon aptconfOperator
  408. hi def link aptconfDoubleColon aptconfOperator
  409. hi def link aptconfCurlyBraces aptconfOperator
  410. hi def link aptconfGroupIncomplete Special
  411. hi def link aptconfGroup aptconfOption
  412. hi def link aptconfAcquire aptconfOption
  413. hi def link aptconfAcquireCDROM aptconfOption
  414. hi def link aptconfAcquireCompressionTypes aptconfOption
  415. hi def link aptconfAcquireFTP aptconfOption
  416. hi def link aptconfAcquireHTTP aptconfOption
  417. hi def link aptconfAcquireHTTPS aptconfOption
  418. hi def link aptconfAcquireMaxValidTime aptconfOption
  419. hi def link aptconfAcquirePDiffs aptconfOption
  420. hi def link aptconfAdequate aptconfOption
  421. hi def link aptconfApt aptconfOption
  422. hi def link aptconfAptAuthentication aptconfOption
  423. hi def link aptconfAptAutoRemove aptconfOption
  424. hi def link aptconfAptCache aptconfOption
  425. hi def link aptconfAptCDROM aptconfOption
  426. hi def link aptconfAptChangelogs aptconfOption
  427. hi def link aptconfAptCompressor aptconfOption
  428. hi def link aptconfAptCompressorAll aptconfOption
  429. hi def link aptconfAptGet aptconfOption
  430. hi def link aptconfAptPeriodic aptconfOption
  431. hi def link aptconfAptUpdate aptconfOption
  432. hi def link aptconfAptitude aptconfOption
  433. hi def link aptconfAptitudeCmdline aptconfOption
  434. hi def link aptconfAptitudeCmdlineProgress aptconfOption
  435. hi def link aptconfAptitudeCmdlineSafeUpgrade aptconfOption
  436. hi def link aptconfAptitudeLogging aptconfOption
  437. hi def link aptconfAptitudeProblemResolver aptconfOption
  438. hi def link aptconfAptitudeSafeResolver aptconfOption
  439. hi def link aptconfAptitudeScreenshot aptconfOption
  440. hi def link aptconfAptitudeSections aptconfOption
  441. hi def link aptconfAptitudeUI aptconfOption
  442. hi def link aptconfAptitudeUIKeyBindings aptconfOption
  443. hi def link aptconfAptitudeUIStyles aptconfOption
  444. hi def link aptconfAptitudeUIStylesElements aptconfOption
  445. hi def link aptconfAptListbugs aptconfOption
  446. hi def link aptconfDebTags aptconfOption
  447. hi def link aptconfDebug aptconfOption
  448. hi def link aptconfDebugAcquire aptconfOption
  449. hi def link aptconfDebugPkgAcquire aptconfOption
  450. hi def link aptconfDebugPkgDepCache aptconfOption
  451. hi def link aptconfDebugPkgProblemResolver aptconfOption
  452. hi def link aptconfDir aptconfOption
  453. hi def link aptconfDirAptitude aptconfOption
  454. hi def link aptconfDirBin aptconfOption
  455. hi def link aptconfDirCache aptconfOption
  456. hi def link aptconfDirEtc aptconfOption
  457. hi def link aptconfDirLog aptconfOption
  458. hi def link aptconfDirMedia aptconfOption
  459. hi def link aptconfDirState aptconfOption
  460. hi def link aptconfDPkg aptconfOption
  461. hi def link aptconfDPkgTools aptconfOption
  462. hi def link aptconfDSelect aptconfOption
  463. hi def link aptconfOrderList aptconfOption
  464. hi def link aptconfOrderListScore aptconfOption
  465. hi def link aptconfPackageManager aptconfOption
  466. hi def link aptconfPkgCacheGen aptconfOption
  467. hi def link aptconfQuiet aptconfOption
  468. hi def link aptconfRpm aptconfOption
  469. hi def link aptconfSynaptic aptconfOption
  470. hi def link aptconfSynapticUpdate aptconfOption
  471. hi def link aptconfUnattendedUpgrade aptconfOption
  472. hi def link aptconfWhatmaps aptconfOption
  473. let b:current_syntax = "aptconf"
  474. let &cpo = s:cpo_save
  475. unlet s:cpo_save