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