Update (switch wdwoods->kurayama for systemd)

See https://github.com/sheerun/vim-polyglot/pull/267
This commit is contained in:
Dan Reif 2018-04-30 12:22:26 -07:00
parent faf6999c44
commit 7408b2a34a
3 changed files with 81 additions and 32 deletions

View File

@ -136,7 +136,7 @@ If you need full functionality of any plugin, please use it directly with your p
- [stylus](https://github.com/wavded/vim-stylus) (syntax, indent, ftplugin) - [stylus](https://github.com/wavded/vim-stylus) (syntax, indent, ftplugin)
- [swift](https://github.com/keith/swift.vim) (syntax, indent, ftplugin) - [swift](https://github.com/keith/swift.vim) (syntax, indent, ftplugin)
- [sxhkd](https://github.com/baskerville/vim-sxhkdrc) (syntax) - [sxhkd](https://github.com/baskerville/vim-sxhkdrc) (syntax)
- [systemd](https://github.com/kurayama/systemd-vim-syntax) (syntax) - [systemd](https://github.com/wgwoods/vim-systemd-syntax) (syntax)
- [terraform](https://github.com/hashivim/vim-terraform) (syntax, indent, ftplugin) - [terraform](https://github.com/hashivim/vim-terraform) (syntax, indent, ftplugin)
- [textile](https://github.com/timcharper/textile.vim) (syntax, ftplugin) - [textile](https://github.com/timcharper/textile.vim) (syntax, ftplugin)
- [thrift](https://github.com/solarnz/thrift.vim) (syntax) - [thrift](https://github.com/solarnz/thrift.vim) (syntax)

View File

@ -978,7 +978,7 @@ endif
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'systemd') == -1 if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'systemd') == -1
augroup filetypedetect augroup filetypedetect
" systemd, from systemd.vim in kurayama/systemd-vim-syntax " systemd, from systemd.vim in wgwoods/vim-systemd-syntax
au BufNewFile,BufRead *.automount set filetype=systemd au BufNewFile,BufRead *.automount set filetype=systemd
au BufNewFile,BufRead *.mount set filetype=systemd au BufNewFile,BufRead *.mount set filetype=systemd
au BufNewFile,BufRead *.path set filetype=systemd au BufNewFile,BufRead *.path set filetype=systemd

View File

@ -26,12 +26,14 @@ syn match sdFormatStr contained /%[inpINPfcrRt]/ containedin=ALLBUT,sdComment,sd
syn match sdUInt contained nextgroup=sdErr /\d\+/ syn match sdUInt contained nextgroup=sdErr /\d\+/
syn match sdInt contained nextgroup=sdErr /-\=\d\+/ syn match sdInt contained nextgroup=sdErr /-\=\d\+/
syn match sdOctal contained nextgroup=sdErr /0\o\{3,4}/ syn match sdOctal contained nextgroup=sdErr /0\o\{3,4}/
" sdDuration: see systemd.time(7)
syn match sdDuration contained nextgroup=sdErr /\d\+/ syn match sdDuration contained nextgroup=sdErr /\d\+/
syn match sdDuration contained nextgroup=sdErr /\%(\d\+\%(s\|min\|h\|d\|w\|ms\|us\)\s*\)\+/ syn match sdDuration contained nextgroup=sdErr /\%(\d\+\s*\%(usec\|msec\|seconds\=\|minutes\=\|hours\=\|days\=\|weeks\=\|months\=\|years\=\|us\|ms\|sec\|min\|hr\|[smhdwMy]\)\s*\)\+/
syn match sdDatasize contained nextgroup=sdErr /\d\+[KMGT]/ syn match sdDatasize contained nextgroup=sdErr /\d\+[KMGT]/
syn match sdFilename contained nextgroup=sdErr /\/\S*/ syn match sdFilename contained nextgroup=sdErr /\/\S*/
syn match sdPercent contained nextgroup=sdErr /\d\+%/
syn keyword sdBool contained nextgroup=sdErr 1 yes true on 0 no false off syn keyword sdBool contained nextgroup=sdErr 1 yes true on 0 no false off
syn match sdUnitName contained /\S\+\.\(automount\|mount\|swap\|socket\|service\|target\|path\|timer\|device\)\_s/ syn match sdUnitName contained /\S\+\.\(automount\|mount\|swap\|socket\|service\|target\|path\|timer\|device\|slice\|scope\)\_s/
" .include " .include
syn match sdInclude /^.include/ nextgroup=sdFilename syn match sdInclude /^.include/ nextgroup=sdFilename
@ -46,46 +48,51 @@ syn region sdUnitBlock matchgroup=sdHeader start=/^\[Unit\]/ end=/^\[/me=e-2 con
syn match sdUnitKey contained /^Description=/ syn match sdUnitKey contained /^Description=/
syn match sdUnitKey contained /^Documentation=/ nextgroup=sdDocURI syn match sdUnitKey contained /^Documentation=/ nextgroup=sdDocURI
syn match sdUnitKey contained /^SourcePath=/ nextgroup=sdFilename,sdErr syn match sdUnitKey contained /^SourcePath=/ nextgroup=sdFilename,sdErr
syn match sdUnitKey contained /^\%(Requires\|RequiresOverridable\|Requisite\|RequisiteOverridable\|Wants\|BindsTo\|PartOf\|Conflicts\|Before\|After\|OnFailure\|Names|PropagatesReloadTo\|ReloadPropagatedFrom\)=/ nextgroup=sdUnitList syn match sdUnitKey contained /^\%(Requires\|RequiresOverridable\|Requisite\|RequisiteOverridable\|Wants\|Binds\=To\|PartOf\|Conflicts\|Before\|After\|OnFailure\|Names|PropagatesReloadTo\|ReloadPropagatedFrom\)=/ nextgroup=sdUnitList
syn match sdUnitKey contained /^\%(OnFailureIsolate\|IgnoreOnIsolate\|IgnoreOnSnapshot\|StopWhenUnneeded\|RefuseManualStart\|RefuseManualStop\|AllowIsolate\|DefaultDependencies\)=/ nextgroup=sdBool,sdErr syn match sdUnitKey contained /^\%(OnFailureIsolate\|IgnoreOnIsolate\|IgnoreOnSnapshot\|StopWhenUnneeded\|RefuseManualStart\|RefuseManualStop\|AllowIsolate\|DefaultDependencies\)=/ nextgroup=sdBool,sdErr
syn match sdUnitKey contained /^OnFailureJobMode=/ nextgroup=sdFailJobMode,sdErr syn match sdUnitKey contained /^OnFailureJobMode=/ nextgroup=sdFailJobMode,sdErr
syn match sdUnitKey contained /^JobTimeoutSec=/ nextgroup=sdDuration,sdErr syn match sdUnitKey contained /^\%(StartLimitInterval\|StartLimitIntervalSec\|JobTimeoutSec\)=/ nextgroup=sdDuration,sdErr
" ConditionXXX. Note that they all have an optional '|' after the '=' syn match sdUnitKey contained /^\%(StartLimitAction\|JobTimeoutAction\)=/ nextgroup=sdLimitAction,sdErr
syn match sdUnitKey contained /^\%(RebootArgument\|JobTimeoutRebootArgument\)=/
" ConditionXXX. Note that they all have an optional '|' after the '='.
syn match sdUnitKey contained /^Condition\(PathExists\|PathExistsGlob\|PathIsDirectory\|PathIsMountPoint\|PathIsReadWrite\|PathIsSymbolicLink\|DirectoryNotEmpty\|FileNotEmpty\|FileIsExecutable\)=|\=!\=/ contains=sdConditionFlag nextgroup=sdFilename,sdErr syn match sdUnitKey contained /^Condition\(PathExists\|PathExistsGlob\|PathIsDirectory\|PathIsMountPoint\|PathIsReadWrite\|PathIsSymbolicLink\|DirectoryNotEmpty\|FileNotEmpty\|FileIsExecutable\)=|\=!\=/ contains=sdConditionFlag nextgroup=sdFilename,sdErr
syn match sdUnitKey contained /^ConditionVirtualization=|\=!\=/ contains=sdConditionFlag nextgroup=sdVirtType,sdErr syn match sdUnitKey contained /^ConditionVirtualization=|\=!\=/ contains=sdConditionFlag nextgroup=sdVirtType,sdErr
syn match sdUnitKey contained /^ConditionSecurity=|\=!\=/ contains=sdConditionFlag nextgroup=sdSecurityType,sdErr syn match sdUnitKey contained /^ConditionSecurity=|\=!\=/ contains=sdConditionFlag nextgroup=sdSecurityType,sdErr
syn match sdUnitKey contained /^ConditionCapability=|\=!\=/ contains=sdConditionFlag nextgroup=sdAnyCapName,sdErr syn match sdUnitKey contained /^ConditionCapability=|\=!\=/ contains=sdConditionFlag nextgroup=sdAnyCapName,sdErr
syn match sdUnitKey contained /^Condition\%(KernelCommandLine\|Host\)=|\=!\=/ contains=sdConditionFlag syn match sdUnitKey contained /^Condition\%(KernelCommandLine\|Host\)=|\=!\=/ contains=sdConditionFlag
syn match sdUnitKey contained /^Condition\%(ACPower\|Null\)=|\=/ contains=sdConditionFlag nextgroup=sdBool,sdErr syn match sdUnitKey contained /^Condition\%(ACPower\|Null\|FirstBoot\)=|\=/ contains=sdConditionFlag nextgroup=sdBool,sdErr
syn match sdUnitKey contained /^ConditionNeedsUpdate=|\=!\=/ contains=sdConditionFlag nextgroup=sdCondUpdateDir,sdErr
" extra bits " extra bits
syn match sdUnitList contained /.*/ contains=sdUnitName,sdErr syn match sdUnitList contained /.*/ contains=sdUnitName,sdErr
syn match sdConditionFlag contained /[!|]/ syn match sdConditionFlag contained /[!|]/
syn match sdCondUpdateDir contained nextgroup=sdErr /\%(\/etc\|\/var\)/
syn keyword sdVirtType contained nextgroup=sdErr vm container qemu kvm vmware microsoft oracle xen bochs chroot openvz lxc lxc-libvirt systemd-nspawn syn keyword sdVirtType contained nextgroup=sdErr vm container qemu kvm vmware microsoft oracle xen bochs chroot openvz lxc lxc-libvirt systemd-nspawn
syn keyword sdSecurityType contained nextgroup=sdErr selinux syn keyword sdSecurityType contained nextgroup=sdErr selinux
syn keyword sdFailJobMode contained nextgroup=sderr fail replace replace-irreversibly syn keyword sdFailJobMode contained nextgroup=sdErr fail replace replace-irreversibly
syn keyword sdLimitAction contained nextgroup=sdErr none reboot reboot-force reboot-immediate poweroff poweroff-force poweroff-immediate
syn match sdDocUri contained /\%(https\=:\/\/\|file:\|info:\|man:\)\S\+\s*/ nextgroup=sdDocUri,sdErr syn match sdDocUri contained /\%(https\=:\/\/\|file:\|info:\|man:\)\S\+\s*/ nextgroup=sdDocUri,sdErr
" [Install] {{{1 " [Install] {{{1
" see systemd.unit(5) " see systemd.unit(5)
syn region sdInstallBlock matchgroup=sdHeader start=/^\[Install\]/ end=/^\[/me=e-2 contains=sdInstallKey syn region sdInstallBlock matchgroup=sdHeader start=/^\[Install\]/ end=/^\[/me=e-2 contains=sdInstallKey
syn match sdInstallKey contained /^\%(WantedBy\|Alias\|Also\)=/ nextgroup=sdUnitList syn match sdInstallKey contained /^\%(WantedBy\|Alias\|Also\|RequiredBy\)=/ nextgroup=sdUnitList
" Execution options common to [Service|Socket|Mount|Swap] {{{1 " Execution options common to [Service|Socket|Mount|Swap] {{{1
" see systemd.exec(5) " see systemd.exec(5)
syn match sdExecKey contained /^Exec\%(Start\%(Pre\|Post\|\)\|Reload\|Stop\|StopPost\)=/ nextgroup=sdExecFlag,sdExecFile,sdErr syn match sdExecKey contained /^Exec\%(Start\%(Pre\|Post\|\)\|Reload\|Stop\|StopPost\)=/ nextgroup=sdExecFlag,sdExecFile,sdErr
syn match sdExecKey contained /^\%(WorkingDirectory\|RootDirectory\|TTYPath\)=/ nextgroup=sdFilename,sdErr syn match sdExecKey contained /^\%(WorkingDirectory\|RootDirectory\|TTYPath\)=/ nextgroup=sdFilename,sdErr
" TODO: handle some of these better " TODO: handle some of these better
" FIXME: some of these have moved to Resource Control
" CPUAffinity is: list of uint " CPUAffinity is: list of uint
" BlockIOWeight is: uint\|filename uint " BlockIOWeight is: uint\|filename uint
" BlockIO\%(Read\|Write\)Bandwidth is: filename datasize " BlockIO\%(Read\|Write\)Bandwidth is: filename datasize
syn match sdExecKey contained /^\%(User\|Group\|SupplementaryGroups\|CPUAffinity\|SyslogIdentifier\|PAMName\|TCPWrapName\|ControlGroup\|ControlGroupAttribute\|DeviceAllow\|DeviceDeny\|BlockIOWeight\|BlockIO\%(Read\|Write\)Bandwidth\|UtmpIdentifier\)=/ syn match sdExecKey contained /^\%(User\|Group\|SupplementaryGroups\|CPUAffinity\|SyslogIdentifier\|PAMName\|TCPWrapName\|ControlGroup\|ControlGroupAttribute\|UtmpIdentifier\)=/
syn match sdExecKey contained /^Limit\%(CPU\|FSIZE\|DATA\|STACK\|CORE\|RSS\|NOFILE\|AS\|NPROC\|MEMLOCK\|LOCKS\|SIGPENDING\|MSGQUEUE\|NICE\|RTPRIO\|RTTIME\)=/ nextgroup=sdRlimit syn match sdExecKey contained /^Limit\%(CPU\|FSIZE\|DATA\|STACK\|CORE\|RSS\|NOFILE\|AS\|NPROC\|MEMLOCK\|LOCKS\|SIGPENDING\|MSGQUEUE\|NICE\|RTPRIO\|RTTIME\)=/ nextgroup=sdRlimit
syn match sdExecKey contained /^\%(CPUSchedulingResetOnFork\|TTYReset\|TTYVHangup\|TTYVTDisallocate\|SyslogLevelPrefix\|ControlGroupModify\|PrivateTmp\|PrivateNetwork\)=/ nextgroup=sdBool,sdErr syn match sdExecKey contained /^\%(CPUSchedulingResetOnFork\|TTYReset\|TTYVHangup\|TTYVTDisallocate\|SyslogLevelPrefix\|ControlGroupModify\|PrivateTmp\|PrivateNetwork\|PrivateDevices\)=/ nextgroup=sdBool,sdErr
syn match sdExecKey contained /^\%(Nice\|OOMScoreAdjust\)=/ nextgroup=sdInt,sdErr syn match sdExecKey contained /^\%(Nice\|OOMScoreAdjust\)=/ nextgroup=sdInt,sdErr
syn match sdExecKey contained /^\%(CPUSchedulingPriority\|TimerSlackNSec\|CPUShares\)=/ nextgroup=sdUInt,sdErr syn match sdExecKey contained /^\%(CPUSchedulingPriority\|TimerSlackNSec\)=/ nextgroup=sdUInt,sdErr
syn match sdExecKey contained /^\%(MemoryLimit\|MemorySoftLimit\)=/ nextgroup=sdDatasize,sdErr
syn match sdExecKey contained /^\%(ReadWrite\|ReadOnly\|Inaccessible\)Directories=/ nextgroup=sdFileList syn match sdExecKey contained /^\%(ReadWrite\|ReadOnly\|Inaccessible\)Directories=/ nextgroup=sdFileList
syn match sdExecKey contained /^Device\%(Allow\|Deny\)=/ nextgroup=sdDevAllow,sdErr
syn match sdExecKey contained /^CapabilityBoundingSet=/ nextgroup=sdCapNameList syn match sdExecKey contained /^CapabilityBoundingSet=/ nextgroup=sdCapNameList
syn match sdExecKey contained /^Capabilities=/ nextgroup=sdCapability,sdErr syn match sdExecKey contained /^Capabilities=/ nextgroup=sdCapability,sdErr
syn match sdExecKey contained /^UMask=/ nextgroup=sdOctal,sdErr syn match sdExecKey contained /^UMask=/ nextgroup=sdOctal,sdErr
@ -98,7 +105,7 @@ syn match sdExecKey contained /^IOSchedulingClass=/ nextgroup=sdIOSchedClass,sdE
syn match sdExecKey contained /^IOSchedulingPriority=/ nextgroup=sdIOSchedPrio,sdErr syn match sdExecKey contained /^IOSchedulingPriority=/ nextgroup=sdIOSchedPrio,sdErr
syn match sdExecKey contained /^CPUSchedulingPolicy=/ nextgroup=sdCPUSchedPol,sdErr syn match sdExecKey contained /^CPUSchedulingPolicy=/ nextgroup=sdCPUSchedPol,sdErr
syn match sdExecKey contained /^MountFlags=/ nextgroup=sdMountFlags,sdErr syn match sdExecKey contained /^MountFlags=/ nextgroup=sdMountFlags,sdErr
syn match sdExecKey contained /^IgnoreSIGPIPE=/ nextgroup=sdBool,sdErr syn match sdExecKey contained /^\%(IgnoreSIGPIPE\|MemoryDenyWriteExecute\)=/ nextgroup=sdBool,sdErr
syn match sdExecKey contained /^Environment=/ nextgroup=sdEnvDefs syn match sdExecKey contained /^Environment=/ nextgroup=sdEnvDefs
syn match sdExecKey contained /^EnvironmentFile=-\=/ contains=sdEnvDashFlag nextgroup=sdFilename,sdErr syn match sdExecKey contained /^EnvironmentFile=-\=/ contains=sdEnvDashFlag nextgroup=sdFilename,sdErr
@ -126,9 +133,6 @@ syn match sdCapOps contained /[=+-]/
syn match sdCapFlags contained /\<[eip]\+/ syn match sdCapFlags contained /\<[eip]\+/
syn match sdCapability contained /\%(\%([A-Za-z_]\+,\=\)*\|all\)\%(=[eip]*\|[+-][eip]\+\)\s*/ contains=@sdCap nextgroup=sdCapability,sdErr syn match sdCapability contained /\%(\%([A-Za-z_]\+,\=\)*\|all\)\%(=[eip]*\|[+-][eip]\+\)\s*/ contains=@sdCap nextgroup=sdCapability,sdErr
"}}} "}}}
syn match sdDevAllow contained /\/\S\+\s\+/ nextgroup=sdDevAllowPerm
syn match sdDevAllowPerm contained /\S\+/ contains=sdDevAllowErr nextgroup=sdErr
syn match sdDevAllowErr contained /[^rwm]\+/
syn keyword sdStdin contained nextgroup=sdErr null tty-force tty-fail socket tty syn keyword sdStdin contained nextgroup=sdErr null tty-force tty-fail socket tty
syn match sdStdout contained nextgroup=sdErr /\%(syslog\|kmsg\|journal\)\%(+console\)\=/ syn match sdStdout contained nextgroup=sdErr /\%(syslog\|kmsg\|journal\)\%(+console\)\=/
syn keyword sdStdout contained nextgroup=sdErr inherit null tty socket syn keyword sdStdout contained nextgroup=sdErr inherit null tty socket
@ -142,22 +146,46 @@ syn keyword sdMountFlags contained nextgroup=sdErr shared slave private
syn match sdRlimit contained nextgroup=sdErr /\<\%(\d\+\|infinity\)\>/ syn match sdRlimit contained nextgroup=sdErr /\<\%(\d\+\|infinity\)\>/
syn keyword sdSecureBits contained nextgroup=sdErr keep-caps keep-caps-locked noroot noroot-locked no-setuid-fixup no-setuid-fixup-locked syn keyword sdSecureBits contained nextgroup=sdErr keep-caps keep-caps-locked noroot noroot-locked no-setuid-fixup no-setuid-fixup-locked
" These are also shared by [Service|Socket|Mount|Swap], although they're not " TODO: which section does this come from?
" listed in systemd.exec(5)
syn match sdExecKey contained /^TimeoutSec=/ nextgroup=sdDuration,sdErr syn match sdExecKey contained /^TimeoutSec=/ nextgroup=sdDuration,sdErr
syn match sdExecKey contained /^KillSignal=/ nextgroup=sdSignal,sdOtherSignal,sdErr
syn match sdExecKey contained /^SendSIGKill=/ nextgroup=sdBool,sdErr " Process killing options for [Service|Socket|Mount|Swap|Scope] {{{1
syn match sdExecKey contained /^KillMode=/ nextgroup=sdKillMode,sdErr " see systemd.kill(5)
syn match sdKillKey contained /^KillSignal=/ nextgroup=sdSignal,sdOtherSignal,sdErr
syn match sdKillKey contained /^KillMode=/ nextgroup=sdKillMode,sdErr
syn match sdKillKey contained /^\%(SendSIGKILL\|SendSIGHUP\)=/ nextgroup=sdBool,sdErr
syn keyword sdSignal contained nextgroup=sdErr SIGHUP SIGINT SIGQUIT SIGKILL SIGTERM SIGUSR1 SIGUSR2 syn keyword sdSignal contained nextgroup=sdErr SIGHUP SIGINT SIGQUIT SIGKILL SIGTERM SIGUSR1 SIGUSR2
syn match sdOtherSignal contained nextgroup=sdErr /\<\%(\d\+\|SIG[A-Z]\{2,6}\)\>/ syn match sdOtherSignal contained nextgroup=sdErr /\<\%(\d\+\|SIG[A-Z]\{2,6}\)\>/
syn match sdKillMode contained nextgroup=sdErr /\%(control-group\|process\|none\)/ syn match sdKillMode contained nextgroup=sdErr /\%(control-group\|process\|none\)/
" Resource Control options for [Service|Socket|Mount|Swap|Slice|Scope] {{{1
" see systemd.resource-control(5)
syn match sdResCtlKey contained /^Slice=/ nextgroup=sdSliceName,sdErr
syn match sdResCtlKey contained /^\%(CPUAccounting\|MemoryAccounting\|IOAccounting\|BlockIOAccounting\|TasksAccounting\|Delegate\)=/ nextgroup=sdBool,sdErr
syn match sdResCtlKey contained /^\%(CPUQuota\)=/ nextgroup=sdPercent,sdErr
syn match sdResCtlKey contained /^\%(CPUShares\|StartupCPUShares\)=/ nextgroup=sdUInt,sdErr
syn match sdResCtlKey contained /^MemoryLow=/ nextgroup=sdDatasize,sdPercent,sdErr
syn match sdResCtlKey contained /^\%(MemoryLimit\|MemoryHigh\|MemoryMax\)=/ nextgroup=sdDatasize,sdPercent,sdInfinity,sdErr
syn match sdResCtlKey contained /^TasksMax=/ nextgroup=sdUInt,sdInfinity,sdErr
syn match sdResCtlKey contained /^\%(IOWeight\|StartupIOWeight\|BlockIOWeight\|StartupBlockIOWeight\)=/ nextgroup=sdUInt,sdErr
syn match sdResCtlKey contained /^DeviceAllow=/ nextgroup=sdDevAllow,sdErr
syn match sdResCtlKey contained /^DevicePolicy=/ nextgroup=sdDevPolicy,sdErr
syn match sdSliceName contained /\S\+\.slice\_s/ contains=sdUnitName
syn keyword sdInfinity contained infinity
syn match sdDevAllow contained /\%(\/dev\/\|char-\|block-\)\S\+\s\+/ nextgroup=sdDevAllowPerm
syn match sdDevAllowPerm contained /\S\+/ contains=sdDevAllowErr nextgroup=sdErr
syn match sdDevAllowErr contained /[^rwm]\+/
syn keyword sdDevPolicy contained strict closed auto
" [Service] {{{1 " [Service] {{{1
syn region sdServiceBlock matchgroup=sdHeader start=/^\[Service\]/ end=/^\[/me=e-2 contains=sdServiceKey,sdExecKey syn region sdServiceBlock matchgroup=sdHeader start=/^\[Service\]/ end=/^\[/me=e-2 contains=sdServiceKey,sdExecKey,sdKillKey,sdResCtlKey
syn match sdServiceKey contained /^BusName=/ syn match sdServiceKey contained /^BusName=/
syn match sdServiceKey contained /^\%(RemainAfterExit\|GuessMainPID\|PermissionsStartOnly\|RootDirectoryStartOnly\|NonBlocking\|ControlGroupModify\)=/ nextgroup=sdBool,sdErr syn match sdServiceKey contained /^\%(RemainAfterExit\|GuessMainPID\|PermissionsStartOnly\|RootDirectoryStartOnly\|NonBlocking\|ControlGroupModify\)=/ nextgroup=sdBool,sdErr
syn match sdServiceKey contained /^\%(SysVStartPriority\|FsckPassNo\)=/ nextgroup=sdUInt,sdErr syn match sdServiceKey contained /^\%(SysVStartPriority\|FsckPassNo\)=/ nextgroup=sdUInt,sdErr
syn match sdServiceKey contained /^\%(Restart\|Timeout\)Sec=/ nextgroup=sdDuration,sdErr syn match sdServiceKey contained /^\%(Restart\|Timeout\|TimeoutStart\|TimeoutStop\|Watchdog\|RuntimeMax\)Sec=/ nextgroup=sdDuration,sdErr
syn match sdServiceKey contained /^Sockets=/ nextgroup=sdUnitList syn match sdServiceKey contained /^Sockets=/ nextgroup=sdUnitList
syn match sdServiceKey contained /^PIDFile=/ nextgroup=sdFilename,sdErr syn match sdServiceKey contained /^PIDFile=/ nextgroup=sdFilename,sdErr
syn match sdServiceKey contained /^Type=/ nextgroup=sdServiceType,sdErr syn match sdServiceKey contained /^Type=/ nextgroup=sdServiceType,sdErr
@ -168,12 +196,12 @@ syn keyword sdRestartType contained nextgroup=sdErr no on-success on-failure on-
syn keyword sdNotifyType contained nextgroup=sdErr none main all syn keyword sdNotifyType contained nextgroup=sdErr none main all
" [Socket] {{{1 " [Socket] {{{1
syn region sdSocketBlock matchgroup=sdHeader start=/^\[Socket\]/ end=/^\[/me=e-2 contains=sdSocketKey,sdExecKey syn region sdSocketBlock matchgroup=sdHeader start=/^\[Socket\]/ end=/^\[/me=e-2 contains=sdSocketKey,sdExecKey,sdKillKey,sdResCtlKey
syn match sdSocketKey contained /^Listen\%(Stream\|Datagram\|SequentialPacket\|FIFO\|Special\|Netlink\|MessageQueue\)=/ syn match sdSocketKey contained /^Listen\%(Stream\|Datagram\|SequentialPacket\|FIFO\|Special\|Netlink\|MessageQueue\)=/
syn match sdSocketKey contained /^Listen\%(FIFO\|Special\)=/ nextgroup=sdFilename,sdErr syn match sdSocketKey contained /^Listen\%(FIFO\|Special\)=/ nextgroup=sdFilename,sdErr
syn match sdSocketKey contained /^\%(Socket\|Directory\)Mode=/ nextgroup=sdOctal,sdErr syn match sdSocketKey contained /^\%(Socket\|Directory\)Mode=/ nextgroup=sdOctal,sdErr
syn match sdSocketKey contained /^\%(Backlog\|MaxConnections\|Priority\|ReceiveBuffer\|SendBuffer\|IPTTL\|Mark\|PipeSize\|MessageQueueMaxMessages\|MessageQueueMessageSize\)=/ nextgroup=sdUInt,sdErr syn match sdSocketKey contained /^\%(Backlog\|MaxConnections\|Priority\|ReceiveBuffer\|SendBuffer\|IPTTL\|Mark\|PipeSize\|MessageQueueMaxMessages\|MessageQueueMessageSize\)=/ nextgroup=sdUInt,sdErr
syn match sdSocketKey contained /^\%(Accept\|KeepAlive\|FreeBind\|Transparent\|Broadcast\)=/ nextgroup=sdBool,sdErr syn match sdSocketKey contained /^\%(Accept\|KeepAlive\|FreeBind\|Transparent\|Broadcast\|Writable\|NoDelay\)=/ nextgroup=sdBool,sdErr
syn match sdSocketKey contained /^BindToDevice=/ syn match sdSocketKey contained /^BindToDevice=/
syn match sdSocketKey contained /^Service=/ nextgroup=sdUnitList syn match sdSocketKey contained /^Service=/ nextgroup=sdUnitList
syn match sdSocketKey contained /^BindIPv6Only=/ nextgroup=sdBindIPv6,sdErr syn match sdSocketKey contained /^BindIPv6Only=/ nextgroup=sdBindIPv6,sdErr
@ -183,11 +211,14 @@ syn keyword sdBindIPv6 contained nextgroup=sdErr default both ipv6-only
syn keyword sdIPTOS contained nextgroup=sdErr low-delay throughput reliability low-cost syn keyword sdIPTOS contained nextgroup=sdErr low-delay throughput reliability low-cost
syn keyword sdTCPCongest contained nextgroup=sdErr westwood veno cubic lp syn keyword sdTCPCongest contained nextgroup=sdErr westwood veno cubic lp
" [Timer|Automount|Mount|Swap|Path] {{{1 " [Timer|Automount|Mount|Swap|Path|Slice|Scope] {{{1
" [Timer] " [Timer]
syn region sdTimerBlock matchgroup=sdHeader start=/^\[Timer\]/ end=/^\[/me=e-2 contains=sdTimerKey syn region sdTimerBlock matchgroup=sdHeader start=/^\[Timer\]/ end=/^\[/me=e-2 contains=sdTimerKey
syn match sdTimerKey contained /^On\%(Active\|Boot\|Startup\|UnitActive\|UnitInactive\)Sec=/ nextgroup=sdDuration,sdErr syn match sdTimerKey contained /^On\%(Active\|Boot\|Startup\|UnitActive\|UnitInactive\)Sec=/ nextgroup=sdDuration,sdErr
syn match sdTimerKey contained /^\%(Accuracy\|RandomizedDelay\)Sec=/ nextgroup=sdDuration,sdErr
syn match sdTimerKey contained /^\%(Persistent\|WakeSystem\|RemainAfterElapse\)=/ nextgroup=sdBool,sdErr
syn match sdTimerKey contained /^Unit=/ nextgroup=sdUnitList syn match sdTimerKey contained /^Unit=/ nextgroup=sdUnitList
" TODO: sdCalendar
" [Automount] " [Automount]
syn region sdAutoMountBlock matchgroup=sdHeader start=/^\[Automount\]/ end=/^\[/me=e-2 contains=sdAutomountKey syn region sdAutoMountBlock matchgroup=sdHeader start=/^\[Automount\]/ end=/^\[/me=e-2 contains=sdAutomountKey
@ -195,21 +226,31 @@ syn match sdAutomountKey contained /^Where=/ nextgroup=sdFilename,sdErr
syn match sdAutomountKey contained /^DirectoryMode=/ nextgroup=sdOctal,sdErr syn match sdAutomountKey contained /^DirectoryMode=/ nextgroup=sdOctal,sdErr
" [Mount] " [Mount]
syn region sdMountBlock matchgroup=sdHeader start=/^\[Mount\]/ end=/^\[/me=e-2 contains=sdMountKey,sdAutomountKey,sdExecKey syn region sdMountBlock matchgroup=sdHeader start=/^\[Mount\]/ end=/^\[/me=e-2 contains=sdMountKey,sdAutomountKey,sdExecKey,sdKillKey,sdResCtlKey
syn match sdMountKey contained /^SloppyOptions=/ nextgroup=sdBool,sdErr
syn match sdMountKey contained /^\%(What\|Type\|Options\)=/ syn match sdMountKey contained /^\%(What\|Type\|Options\)=/
" [Swap] " [Swap]
syn region sdSwapBlock matchgroup=sdHeader start=/^\[Swap\]/ end=/^\[/me=e-2 contains=sdSwapKey,sdExecKey syn region sdSwapBlock matchgroup=sdHeader start=/^\[Swap\]/ end=/^\[/me=e-2 contains=sdSwapKey,sdExecKey,sdKillKey,sdResCtlKey
syn match sdSwapKey contained /^What=/ nextgroup=sdFilename,sdErr syn match sdSwapKey contained /^What=/ nextgroup=sdFilename,sdErr
syn match sdSwapKey contained /^Priority=/ nextgroup=sdUInt,sdErr syn match sdSwapKey contained /^Priority=/ nextgroup=sdUInt,sdErr
syn match sdSwapKey contained /^Options=/
" [Path] " [Path]
syn region sdPathBlock matchgroup=sdHeader start=/^\[Path\]/ end=/^\[/me=e-2 contains=sdPathKey syn region sdPathBlock matchgroup=sdHeader start=/^\[Path\]/ end=/^\[/me=e-2 contains=sdPathKey
syn match sdPathKey contained /^\%(PathExists\|PathExistsGlob\|PathChanged\|DirectoryNotEmpty\)=/ nextgroup=sdFilename,sdErr syn match sdPathKey contained /^\%(PathExists\|PathExistsGlob\|PathChanged\|PathModified\|DirectoryNotEmpty\)=/ nextgroup=sdFilename,sdErr
syn match sdPathKey contained /^MakeDirectory=/ nextgroup=sdBool,sdErr syn match sdPathKey contained /^MakeDirectory=/ nextgroup=sdBool,sdErr
syn match sdPathKey contained /^DirectoryMode=/ nextgroup=sdOctal,sdErr syn match sdPathKey contained /^DirectoryMode=/ nextgroup=sdOctal,sdErr
syn match sdPathKey contained /^Unit=/ nextgroup=sdUnitList syn match sdPathKey contained /^Unit=/ nextgroup=sdUnitList
" [Slice]
syn region sdSliceBlock matchgroup=sdHeader start=/^\[Slice\]/ end=/^\[/me=e-2 contains=sdSliceKey,sdResCtlKey,sdKillKey
" [Scope]
syn region sdScopeBlock matchgroup=sdHeader start=/^\[Scope\]/ end=/^\[/me=e-2 contains=sdScopeKey,sdResCtlKey,sdKillKey
syn match sdScopeKey contained /^TimeoutStopSec=/ nextgroup=sdDuration,sdErr
" Coloring definitions {{{1 " Coloring definitions {{{1
hi def link sdComment Comment hi def link sdComment Comment
hi def link sdTodo Todo hi def link sdTodo Todo
@ -231,6 +272,8 @@ hi def link sdSymbol Special
hi def link sdUnitKey sdKey hi def link sdUnitKey sdKey
hi def link sdInstallKey sdKey hi def link sdInstallKey sdKey
hi def link sdExecKey sdKey hi def link sdExecKey sdKey
hi def link sdKillKey sdKey
hi def link sdResCtlKey sdKey
hi def link sdSocketKey sdKey hi def link sdSocketKey sdKey
hi def link sdServiceKey sdKey hi def link sdServiceKey sdKey
hi def link sdServiceCommonKey sdKey hi def link sdServiceCommonKey sdKey
@ -239,6 +282,7 @@ hi def link sdMountKey sdKey
hi def link sdAutomountKey sdKey hi def link sdAutomountKey sdKey
hi def link sdSwapKey sdKey hi def link sdSwapKey sdKey
hi def link sdPathKey sdKey hi def link sdPathKey sdKey
hi def link sdScopeKey sdKey
" Coloring links: constant values {{{1 " Coloring links: constant values {{{1
hi def link sdInt sdValue hi def link sdInt sdValue
@ -246,6 +290,9 @@ hi def link sdUInt sdValue
hi def link sdBool sdValue hi def link sdBool sdValue
hi def link sdOctal sdValue hi def link sdOctal sdValue
hi def link sdDuration sdValue hi def link sdDuration sdValue
hi def link sdPercent sdValue
hi def link sdInfinity sdValue
hi def link sdDatasize sdValue
hi def link sdVirtType sdValue hi def link sdVirtType sdValue
hi def link sdServiceType sdValue hi def link sdServiceType sdValue
hi def link sdNotifyType sdValue hi def link sdNotifyType sdValue
@ -254,6 +301,7 @@ hi def link sdSecureBits sdValue
hi def link sdMountFlags sdValue hi def link sdMountFlags sdValue
hi def link sdKillMode sdValue hi def link sdKillMode sdValue
hi def link sdFailJobMode sdValue hi def link sdFailJobMode sdValue
hi def link sdLimitAction sdValue
hi def link sdRestartType sdValue hi def link sdRestartType sdValue
hi def link sdSignal sdValue hi def link sdSignal sdValue
hi def link sdStdin sdValue hi def link sdStdin sdValue
@ -264,6 +312,7 @@ hi def link sdIOSched sdValue
hi def link sdCPUSched sdValue hi def link sdCPUSched sdValue
hi def link sdRlimit sdValue hi def link sdRlimit sdValue
hi def link sdCapName sdValue hi def link sdCapName sdValue
hi def link sdDevPolicy sdValue
hi def link sdDevAllowPerm sdValue hi def link sdDevAllowPerm sdValue
hi def link sdDevAllowErr Error hi def link sdDevAllowErr Error