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