summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ftdetect/kickstart.vim1
-rw-r--r--ftdetect/systemd.vim8
-rw-r--r--syntax/kickstart.vim96
-rw-r--r--syntax/spec.vim151
-rw-r--r--syntax/systemd.vim215
5 files changed, 471 insertions, 0 deletions
diff --git a/ftdetect/kickstart.vim b/ftdetect/kickstart.vim
new file mode 100644
index 0000000..ee4acfc
--- /dev/null
+++ b/ftdetect/kickstart.vim
@@ -0,0 +1 @@
+au BufNewFile,BufRead *.ks set filetype=kickstart
diff --git a/ftdetect/systemd.vim b/ftdetect/systemd.vim
new file mode 100644
index 0000000..f03fbcb
--- /dev/null
+++ b/ftdetect/systemd.vim
@@ -0,0 +1,8 @@
+au BufNewFile,BufRead *.automount set filetype=systemd
+au BufNewFile,BufRead *.mount set filetype=systemd
+au BufNewFile,BufRead *.path set filetype=systemd
+au BufNewFile,BufRead *.service set filetype=systemd
+au BufNewFile,BufRead *.socket set filetype=systemd
+au BufNewFile,BufRead *.swap set filetype=systemd
+au BufNewFile,BufRead *.target set filetype=systemd
+au BufNewFile,BufRead *.timer set filetype=systemd
diff --git a/syntax/kickstart.vim b/syntax/kickstart.vim
new file mode 100644
index 0000000..a691d34
--- /dev/null
+++ b/syntax/kickstart.vim
@@ -0,0 +1,96 @@
+" Filename: kickstart.vim
+" Purpose: Vim syntax file
+" Language: kickstart scripting for anaconda, the Red Hat/Fedora installer
+" Maintainer: Will Woods <wwoods@redhat.com>
+" Last Change: Wed Mar 9 15:01:02 EST 2011
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+syntax case match
+
+" include other possible scripting languages people might use
+let b:is_bash=1
+syntax include @Shell syntax/sh.vim
+unlet b:current_syntax " ha ha lies
+syntax include @Python syntax/python.vim
+unlet b:current_syntax " more lies
+syntax include @Perl syntax/perl.vim
+
+" comments
+syntax region ksComment start=/#/ end=/$/ contains=ksTodo
+syntax keyword ksTodo contained FIXME NOTE TODO NOTES XXX
+
+" commands
+syntax keyword ksCommands contained auth autoconfig autopart autostep bootloader btrfs clearpart cmdline device dmraid driverdisk fcoe firewall firstboot graphical group halt harddrive ignoredisk install iscsi iscsiname key keyboard lang logging logvol mediacheck multipath network nfs part partition poweroff raid reboot repo rescue rootpw selinux services shutdown skipx sshpw text timezone updates upgrade url user vnc volgroup xconfig zerombr zfcp
+syntax keyword ksDeprecatedCommands contained mouse langsupport interactive monitor
+
+" only match commands at the start of a new line
+syntax match ksCommandLine '^\s*\l\+' contains=ksUnknownCommand nextgroup=ksCommandOpts
+syntax match ksUnknownCommand contained '\l\+' contains=ksCommands,ksDeprecatedCommands
+syntax match ksCommandOpts contained '.*$' contains=ksFlag,ksComment
+syntax match ksFlag contained '--\a[a-zA-Z-]*=\?'
+syntax match ksUnknownFlag contained '--\a[a-zA-Z-]*=\?'
+
+" includes
+syntax match ksIncludes '^\s*\(%include\|%ksappend\)'
+
+" general section start/end markers
+syntax match ksSectionMarker contained '^\s*%\(pre\|post\|packages\|traceback\|end\)'
+
+" %package section
+syntax region ksPackages start=/^\s*%packages/ matchgroup=ksSectionMarker end=/^\s*%end\_s/ contains=ksPackagesHeader,ksPackageItem,ksPackageGroup,ksComment
+syntax match ksPackagesHeader contained '^\s*%packages.*$' contains=ksSectionMarker,ksPackagesFlag,ksUnknownFlag,ksComment
+syntax match ksPackagesFlag contained '--\(default\|excludedocs\|ignoremissing\|nobase\|instLangs=\?\)'
+syntax match ksPackageItem contained '^\s*[^@#%]\S*' contains=ksPackageGlob,ksPackageMinus
+syntax match ksPackageGroup contained '^\s*@\S*'
+syntax match ksPackageMinus contained '^\s*-'
+syntax match ksPackageGlob contained '\*'
+
+" script sections (%pre, %post, %traceback)
+syntax region ksShellScript start=/^\s*%\(pre\|post\|traceback\)/ matchgroup=ksSectionMarker end=/^\s*%end\_s/ contains=@Shell,ksScriptHeader
+syntax region ksOtherScript start=/^\s*%\(pre\|post\|traceback\)\s.*--interpreter=.*$/ matchgroup=ksSectionMarker end=/^\s*%end\_s/ contains=ksScriptHeader
+syntax region ksPythonScript start=/^\s*%\(pre\|post\|traceback\)\s.*--interpreter=\S*python.*$/ matchgroup=ksSectionMarker end=/^\s*%end\_s/ contains=@Python,ksScriptHeader
+syntax region ksPerlScript start=/^\s*%\(pre\|post\|traceback\)\s.*--interpreter=\S*perl.*$/ matchgroup=ksSectionMarker end=/^\s*%end\_s/ contains=@Perl,ksScriptHeader
+syntax match ksScriptHeader contained '^\s*%\(pre\|post\|traceback\).*' contains=ksSectionMarker,ksScriptFlag,ksUnknownFlag,ksComment
+syntax match ksScriptFlag contained '--\(nochroot\|erroronfail\|log=\?\|interpreter=\?\)'
+
+" sync to section markers
+syntax sync match ksSync grouphere NONE "^\s*%\(pre\|post\|packages\|traceback\)"
+syntax sync match ksSync groupthere NONE "^\s*%end"
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_kickstart_syntax_inits")
+ if version < 508
+ let did_kickstart_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+ HiLink ksComment Comment
+ HiLink ksTodo Todo
+ HiLink ksCommands Statement
+ HiLink ksDeprecatedCommands Special
+ HiLink ksUnknownCommand Error
+ HiLink ksIncludes Include
+ HiLink ksSectionMarker Structure
+ HiLink ksScriptFlag ksFlag
+ HiLink ksPackagesFlag ksFlag
+ HiLink ksFlag Identifier
+ HiLink ksUnknownFlag Error
+ HiLink ksPackageMinus Special
+ HiLink ksPackageGroup Include
+ HiLink ksPackageGlob Operator
+ delcommand HiLink
+endif
+
+let b:current_syntax = "kickstart"
+
+" vim: ts=8
diff --git a/syntax/spec.vim b/syntax/spec.vim
new file mode 100644
index 0000000..974e1f8
--- /dev/null
+++ b/syntax/spec.vim
@@ -0,0 +1,151 @@
+" Filename: spec.vim
+" Purpose: Vim syntax file
+" Language: SPEC: Build/install scripts for Linux RPM packages
+" Maintainer: Will Woods <wwoods@redhat.com>
+" Last Change: Tue Mar 29 11:38:02 EDT 2011
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+syn case match
+syn sync minlines=1000 " kinda dumb but specfiles are never *that* long
+
+" include sh for the script regions
+let b:is_bash=1
+syntax include @Shell syntax/sh.vim
+unlet b:current_syntax
+
+" comments
+syn region specComment start=/^\s*#/ end=/$/ contains=specTodo
+syn keyword specTodo contained FIXME NOTE TODO NOTES XXX HACK
+
+" general stuff
+syn match specURL '\%(https\?\|ftp\)://\S\+' contains=specMacro
+syn match specContinue '\\$'
+syn match specVersion contained '\s\%(\d\+:\)\?\d\+\%(\.\d\+\)*\%(-\d[^- ,]*\)\?'
+
+" preamble / RPM headers
+syn match specRPMHeader '^\%(Name\|Group\|Summary\|BuildRoot\|Source\d*\|Patch\d*\|URL\):'
+syn match specRPMHeader '^\%(Version\|Release\):' nextgroup=specVersion
+syn match specRPMHeader '^\%(Provides\|Requires\%((\%(pre\|post\|preun\|postun\))\)\?\|Conflicts\|Obsoletes\|BuildRequires\|BuildConflicts\):' nextgroup=specPRCO
+syn match specPRCOOperator '[<>!]\?='
+syn match specPRCO contained '.*' contains=specPRCOOperator,specVersion,specMacro,specContinue
+syn match specRPMHeader '^License:\s*' nextgroup=specRPMLicenseInfo
+syn match specRPMLicenseInfo contained '.*' contains=specLicense
+syn match specRPMHeader '^\%(Auto\%(Req\|Prov\)\|\%(Build\|Exclusive\)\%(Arch\|OS\)\):'
+
+" common / builtin macro names
+syn keyword specMacroNames contained arm ix86 sparc nil name version release dist optflags
+syn keyword specMacroNames contained buildroot _sysconfdir _prefix _exec_prefix _bindir _libdir _libexecdir _sbindir _sharedstatedir _datarootdir _datadir _includedir _infodir _mandir _localstatedir _initddir _var _usr _tmppath _usrsrc _lib _docdir
+syn keyword specMacroNames contained _topdir _builddir _rpmdir _sourcedir _specdir _srcrpmdir _buildrootdir
+" simple macros
+syn match specMacroSym '%' contained
+syn match specMacro '%[*#]' contains=specMacroSym
+syn match specMacro '%\w\+' contains=specMacroNames,specMacroSym
+" more complex macros
+" TODO: handle %{identifier:value} better
+syn region specMacro matchgroup=specMacroSym start='%{' end='}' contains=specMacroMod,specMacroNames,specMacroBuiltin,specMacro
+syn match specMacroMod contained '\%(?\|!\|!?\|:\)'
+syn match specMacroBuiltin contained '\%(echo\|warn\|error\|uncompress\|expand\|[SPF]\)\s*:' contains=specMacroMod
+syn region specMacro matchgroup=specMacroSym start='%(' end=')' contains=@Shell,specMacro
+
+" macro commands
+syn match specMacroCommands '%\%(patch\d*\|configure\|find_lang\|makeinstall\|setup\)'
+syn match specMacroCommands '%{\%(patch\d*\|configure\|find_lang\|makeinstall\|setup\)}'
+
+" define/control
+syn match specDefine '%\%(define\|undefine\|global\)' nextgroup=specIdentifier skipwhite
+syn match specIdentifier '[A-Za-z0-9_]\+' contained nextgroup=specDefinition skipwhite
+syn match specDefinition '.*$' contained contains=specMacro,specVersion,specContinue
+syn match specControl '^%\%(ifnarch\|ifarch\|if\)' skipwhite nextgroup=specCondition
+syn match specCondition '.*$' contained contains=specMacro,specVersion,specContinue,specPRCOOperator,specMacroMod
+syn match specControl '^%\%(else\|endif\)\>'
+
+" section markers
+syn match specSectionMarker '^%\%(description\|files\|package\|prep\|build\|install\|clean\|pre\|post\|preun\|postun\|posttrans\|changelog\)\>'
+" shell sections
+syn region specSectionShell matchgroup=specSectionMarker start='^%\%(prep\|build\|install\|clean\|preun\|postun\|posttrans\|pre\|post\|changelog\)' end='^%\%(description\|files\|package\|prep\|build\|install\|clean\|preun\|postun\|posttrans\|pre\|post\|changelog\)\>'me=s-1 contains=specMacro,specMacroNames,specControl,specDefine,specMacroCommands,@Shell
+" changelog section
+syn region specChangeLog matchgroup=specSectionMarker start='^%changelog\>' end='^%' contains=specChangelogHeader,specURL,specBugID
+
+
+" This covers the most common licenses in Fedora
+syn keyword specLicense contained AFL BSD CC0 CDDL CeCILL FTL GFDL ISC MIT NCSA OFL PHP SISSL TCL TORQUEv1.1 UCD W3C ZPLv2.1
+syn keyword specLicense contained Boost ImageMagick Lucida Netscape OpenPBS OpenSSL PostgreSQL Python Ruby Utopia wxWidgets zlib
+syn match specLicense contained '\<\([CEMQST]\|ER\|LP\|NG\|WTF\)PL\>'
+syn match specLicense contained '\<[AL]\?GPL\(v[23]\)\?+\?\( with exceptions\?\| or Artistic\)\?'
+syn match specLicense contained '\<\(ASL \(1.[01]\|2.0\)\>\|Artistic \(clarified\|2.0\)\|MPLv1.[01]\)\>'
+syn match specLicense contained '\<CC-BY\(-SA\|-ND\)\?\>'
+syn match specLicense contained '\<\(MIT\|BSD\) with advertising\>'
+syn match specLicense contained '\<\(Public Domain\|Copyright only\|Freely redistributable without restriction\|Redistributable, no modification permitted\)\>'
+
+" Changelog stuff
+syn keyword specWeekday contained Mon Tue Wed Thu Fri Sat Sun
+syn keyword specWeekday contained Monday Tuesday Wednesday Thursday Friday Saturday Sunday
+syn keyword specMonth contained Jan Feb Mar Apr Jun Jul Aug Sep Oct Nov Dec
+syn keyword specMonth contained January February March April May June July August September October November December
+syn match specDate contained '\u\l\+ \+\u\l\+ \+\d\d\? \+\d\d\d\d' contains=specWeekday,specMonth
+syn match specEmail contained '<.\+>'
+syn match specEmail contained "<\?\S\+@\%([A-Za-z0-9_-]\+\.\)\+\a\+>\?"
+syn match specChangelogHeader contained '^\*.*$' contains=specDate,specEmail,specVersion
+
+syn match specBugID contained '\%([Bb]ug\|\a*[Bb][Zz]\)[ #]*\d\+'
+
+"####################################
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_spec_syntax_inits")
+ if version < 508
+ let did_spec_syntax_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ "main types color definitions
+ HiLink specComment Comment
+ HiLink specTodo Todo
+ HiLink specRPMHeader Statement
+ HiLink specDefine PreProc
+ HiLink specControl Identifier
+ HiLink specMacroCommands Macro
+ HiLink specIdentifier Identifier
+ HiLink specMacroSym Special
+ HiLink specMacroMod Operator
+ HiLink specSectionMarker Structure
+ HiLink specURL PreProc
+ HiLink specEmail PreProc
+ HiLink specVersion Constant
+ HiLink specBugID Constant
+ HiLink specPRCOOperator Operator
+ HiLink specContinue Operator
+ HiLink specDate String
+ HiLink specLicense String
+
+ "yes, it's ugly, but white is sooo cool
+ if &background == "dark"
+ hi def specMacroNames ctermfg=white
+ else
+ HiLink specMacroNames Identifier
+ endif
+
+ "colors mapped onto other things
+ HiLink specRPMHeaderSimple specRPMHeader
+ HiLink specRPMHeaderVersion specRPMHeader
+ HiLink specMacroBuiltin specMacroNames
+ HiLink specWeekday specDate
+ HiLink specMonth specDate
+
+ delcommand HiLink
+endif
+
+let b:current_syntax = "spec"
+
+" vim: ts=8
diff --git a/syntax/systemd.vim b/syntax/systemd.vim
new file mode 100644
index 0000000..fd40325
--- /dev/null
+++ b/syntax/systemd.vim
@@ -0,0 +1,215 @@
+" Filename: systemd.vim
+" Purpose: Vim syntax file
+" Language: systemd unit files
+" Maintainer: Will Woods <wwoods@redhat.com>
+" Last Change: Sep 8, 2011
+
+if exists("b:current_syntax") && !exists ("g:syntax_debug")
+ finish
+endif
+
+syn case match
+syntax sync fromstart
+setlocal iskeyword+=-
+
+" hilight errors with this
+syn match sdErr contained /\s*\S\+/ nextgroup=sdErr
+
+" special sequences
+syn match sdEnvArg contained /\$\i\+\|\${\i\+}/
+syn match sdFormatStr contained /%[nNpPIfcrRt]/ containedin=ALLBUT,sdComment,sdErr
+
+" common data types
+syn match sdInt contained nextgroup=sdErr /\d\+/
+syn match sdOctal contained nextgroup=sdErr /0\o\{3,4}/
+syn match sdDuration contained nextgroup=sdErr /\d\+/
+syn match sdDuration contained nextgroup=sdErr /\%(\d\+\%(s\|min\|h\|d\|w\|ms\|us\)\s*\)\+/
+syn match sdFilename contained nextgroup=sdErr /\/\S\+/
+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/
+" FIXME: sdFormatStr doesn't get hilighted in sdUnitName...
+
+" .include
+syn match sdInclude /^.include/ nextgroup=sdFilename
+
+" comments
+syn match sdComment /^[;#].*/ contains=sdTodo containedin=ALL
+syn keyword sdTodo contained TODO XXX FIXME NOTE
+
+" [Unit]
+syn region sdUnitBlock matchgroup=sdHeader start=/^\[Unit\]/ end=/^\[/me=e-2 contains=sdUnitKey
+syn match sdUnitKey contained /^Description=/
+syn match sdUnitKey contained /^\%(Requires\|RequiresOverridable\|Requisite\|RequisiteOverridable\|Wants\|BindTo\|Conflicts\|Before\|After\|OnFailure\|Names\)=/ nextgroup=sdUnitList
+syn match sdUnitKey contained /^\%(OnFailureIsolate\|IgnoreOnIsolate\|IgnoreOnSnapshot\|StopWhenUnneeded\|RefuseManualStart\|RefuseManualStop\|AllowIsolate\|DefaultDependencies\)=/ nextgroup=sdBool,sdErr
+syn match sdUnitKey contained /^JobTimeoutSec=/ nextgroup=sdDuration,sdErr
+syn match sdUnitKey contained /^Condition\(PathExists\|PathExistsGlob\|PathIsDirectory\|DirectoryNotEmpty\|FileIsExecutable\)=|\=!\=/ contains=sdConditionFlag nextgroup=sdFilename,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 /^Condition\(KernelCommandLine\|Null\)=|\=!\=/ contains=sdConditionFlag
+syn match sdUnitList contained /.*/ contains=sdUnitName,sdErr
+syn match sdConditionFlag contained /[!|]/
+syn keyword sdVirtType contained nextgroup=sdErr qemu kvm vmware microsoft oracle xen pidns openvz
+syn keyword sdSecurityType contained nextgroup=sdErr selinux
+
+" [Install]
+syn region sdInstallBlock matchgroup=sdHeader start=/^\[Install\]/ end=/^\[/me=e-2 contains=sdInstallKey
+syn match sdInstallKey contained /^\%(WantedBy\|Alias\|Also\)=/ nextgroup=sdUnitList
+
+" common stuff used in Service, Socket, Mount, and Swap
+syn match sdKillKey contained /^TimeoutSec=/ nextgroup=sdDuration,sdErr
+syn match sdKillKey contained /^KillSignal=/ nextgroup=sdSignal,sdOtherSignal,sdErr
+syn match sdKillKey contained /^SendSIGKill=/ nextgroup=sdBool,sdErr
+syn match sdKillKey contained /^KillMode=/ nextgroup=sdKillMode,sdErr
+syn match sdKillMode contained nextgroup=sdErr /\%(control-group\|process\|none\)/
+syn match sdExecKey contained /^Exec\%(Start\%(Pre\|Post\|\)\|Reload\|Stop\|StopPost\)=/ nextgroup=sdExecFlag,sdExecFile,sdErr
+syn match sdExecFlag contained /-\=@\=/ nextgroup=sdExecFile,sdErr
+syn match sdExecFile contained /\/\S\+/ nextgroup=sdExecArgs
+syn match sdExecArgs contained /.*/ contains=sdEnvArg
+
+" [Service]
+syn region sdServiceBlock matchgroup=sdHeader start=/^\[Service\]/ end=/^\[/me=e-2 contains=sdServiceKey,sdExecKey,sdKillKey
+syn match sdServiceKey contained /^\%(WorkingDirectory\|RootDirectory\|TTYPath\)=/ nextgroup=sdFilename,sdErr
+" FIXME: some of these could be better handled
+syn match sdServiceKey contained /^\%(User\|Group\|SupplementaryGroups\|Nice\|OOMScoreAdjust\|\%(IO\|CPU\)SchedulingPriority\|CPUAffinity\|UMask\|SyslogIdentifier\|PAMName\|TCPWrapName\|CapabilityBoundingSet\|Capabilities\|ControlGroup\|ControlGroupAttribute\|CPUShares\|MemoryLimit\|MemorySoftLimit\|DeviceAllow\|DeviceDeny\|BlockIOWeight\|BlockIO\%(Read\|Write\)Bandwidth\|\%(ReadWrite\|ReadOnly\|Inaccessible\)Directories\|UtmpIdentifier\|BusName\)=/
+" TODO: CapabilityBoundingSet=CAP_[A-Z_]\+
+" TODO: Umask is sdOctal
+syn match sdServiceKey contained /^\%(CPUSchedulingResetOnFork\|TTYReset\|TTYVHangup\|TTYVTDisallocate\|SyslogLevelPrefix\|ControlGroupModify\|PrivateTmp\|PrivateNetwork\)=/ nextgroup=sdBool,sdErr
+syn match sdServiceKey contained /^\%(RemainAfterExit\|GuessMainPID\|PermissionsStartOnly\|RootDirectoryStartOnly\|NonBlocking\|ControlGroupModify\)=/ nextgroup=sdBool,sdErr
+syn match sdServiceKey contained /^\%(SysVStartPriority\|FsckPassNo\)=/ nextgroup=sdInt,sdErr
+syn match sdServiceKey contained /^\%(Restart\|Timeout\)Sec=/ nextgroup=sdDuration,sdErr
+syn match sdServiceKey contained /^Limit\%(CPU\|FSIZE\|DATA\|STACK\|CORE\|RSS\|NOFILE\|AS\|NPROC\|MEMLOCK\|LOCKS\|SIGPENDING\|MSGQUEUE\|NICE\|RTPRIO\|RTTIME\)=/ nextgroup=sdRlimit
+syn match sdServiceKey contained /^Sockets=/ nextgroup=sdUnitList
+syn match sdServiceKey contained /^PIDFile=/ nextgroup=sdFilename,sdErr
+syn match sdServiceKey contained /^Type=/ nextgroup=sdServiceType,sdErr
+syn match sdServiceKey contained /^Restart=/ nextgroup=sdRestartType,sdErr
+syn match sdServiceKey contained /^NotifyAccess=/ nextgroup=sdNotifyType,sdErr
+syn match sdServiceKey contained /^MountFlags=/ nextgroup=sdMountFlags,sdErr
+syn match sdServiceKey contained /^EnvironmentFile=-\=/ contains=sdEnvDashFlag nextgroup=sdFilename,sdErr
+syn match sdServiceKey contained /^StandardInput=/ nextgroup=sdStdin,sdErr
+syn match sdServiceKey contained /^Standard\%(Output\|Error\)=/ nextgroup=sdStdout,sdErr
+syn match sdServiceKey contained /^SyslogFacility=/ nextgroup=sdSyslogFacil,sdErr
+syn match sdServiceKey contained /^SyslogLevel=/ nextgroup=sdSyslogLevel,sdErr
+syn match sdServiceKey contained /^IOSchedulingClass=/ nextgroup=sdIOSched
+syn match sdServiceKey contained /^CPUSchedulingPolicy=/ nextgroup=sdCPUSched
+syn match sdServiceKey contained /^SecureBits=/ nextgroup=sdSecureBitList
+syn match sdServiceKey contained /^Environment=/ nextgroup=sdEnvDefs
+syn match sdSecureBitList contained /.*/ contains=sdSecureBits
+syn match sdEnvDefs contained /.*/ contains=sdEnvDef
+syn match sdEnvDashFlag contained /-/ nextgroup=sdFilename,sdErr
+syn match sdEnvDef contained /\i\+=/he=e-1
+syn keyword sdServiceType contained nextgroup=sdErr simple forking dbus oneshot notify
+syn keyword sdRestartType contained nextgroup=sdErr no on-success on-failure on-abort always
+syn keyword sdNotifyType contained nextgroup=sdErr none main all
+syn keyword sdMountFlags contained nextgroup=sdErr shared slave private
+syn keyword sdStdin contained nextgroup=sdErr null tty-force tty-fail socket tty
+syn match sdStdout contained nextgroup=sdErr /\<\%(syslog\|kmsg\)\%(+console\)\=\>/
+syn keyword sdStdout contained nextgroup=sdErr inherit null tty socket
+syn keyword sdSyslogFacil contained nextgroup=sdErr kern user mail daemon auth syslog lpr news uucp cron authpriv ftp
+syn match sdSyslogFacil contained nextgroup=sdErr /\<local[0-7]\>/
+syn keyword sdSyslogLevel contained nextgroup=sdErr emerg alert crit err warning notice info debug
+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 sdSecureBits contained nextgroup=sdErr /\<\%(keep-caps\|no-setuid-fixup\|noroot\)\%(-locked\)\=\>/
+syn match sdRlimit contained nextgroup=sdErr /\<\%(\d\+\|infinity\)\>/
+syn keyword sdIOSched contained nextgroup=sdErr none realtime best-effort idle
+syn keyword sdCPUSched contained nextgroup=sdErr other batch idle fifo rr
+
+" [Socket]
+syn region sdSocketBlock matchgroup=sdHeader start=/^\[Socket\]/ end=/^\[/me=e-2 contains=sdSocketKey,sdExecKey,sdKillKey
+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 /^\%(Socket\|Directory\)Mode=/ nextgroup=sdOctal,sdErr
+syn match sdSocketKey contained /^\%(Backlog\|MaxConnections\|Priority\|ReceiveBuffer\|SendBuffer\|IPTTL\|Mark\|PipeSize\|MessageQueueMaxMessages\|MessageQueueMessageSize\)=/ nextgroup=sdInt,sdErr
+syn match sdSocketKey contained /^\%(Accept\|KeepAlive\|FreeBind\|Transparent\|Broadcast\)=/ nextgroup=sdBool,sdErr
+syn match sdSocketKey contained /^BindToDevice=/
+syn match sdSocketKey contained /^Service=/ nextgroup=sdUnitList
+syn match sdSocketKey contained /^BindIPv6Only=/ nextgroup=sdBindIPv6,sdErr
+syn match sdSocketKey contained /^IPTOS=/ nextgroup=sdIPTOS,sdInt,sdErr
+syn match sdSocketKey contained /^TCPCongestion=/ nextgroup=sdTCPCongest
+syn keyword sdBindIPv6 contained nextgroup=sdErr default both ipv6-only
+syn keyword sdIPTOS contained nextgroup=sdErr low-delay throughput reliability low-cost
+syn keyword sdTCPCongest contained nextgroup=sdErr westwood veno cubic lp
+
+" [Timer]
+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 /^Unit=/ nextgroup=sdUnitList
+
+" [Automount]
+syn region sdAutoMountBlock matchgroup=sdHeader start=/^\[Automount\]/ end=/^\[/me=e-2 contains=sdAutomountKey
+syn match sdAutomountKey contained /^Where=/ nextgroup=sdFilename,sdErr
+syn match sdAutomountKey contained /^DirectoryMode=/ nextgroup=sdOctal,sdErr
+
+" [Mount]
+syn region sdMountBlock matchgroup=sdHeader start=/^\[Mount\]/ end=/^\[/me=e-2 contains=sdMountKey,sdAutomountKey,sdKillKey
+syn match sdMountKey contained /^\%(What\|Type\|Options\)=/
+
+" [Swap]
+syn region sdSwapBlock matchgroup=sdHeader start=/^\[Swap\]/ end=/^\[/me=e-2 contains=sdSwapKey,sdKillKey
+syn match sdSwapKey contained /^What=/ nextgroup=sdFilename,sdErr
+syn match sdSwapKey contained /^Priority=/ nextgroup=sdInt,sdErr
+
+" [Path]
+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 /^MakeDirectory=/ nextgroup=sdBool,sdErr
+syn match sdPathKey contained /^DirectoryMode=/ nextgroup=sdOctal,sdErr
+syn match sdPathKey contained /^Unit=/ nextgroup=sdUnitList
+
+" set up coloring
+hi def link sdComment Comment
+hi def link sdTodo Todo
+hi def link sdInclude PreProc
+hi def link sdHeader Type
+hi def link sdEnvArg PreProc
+hi def link sdFormatStr Special
+hi def link sdErr Error
+hi def link sdEnvDef Identifier
+hi def link sdUnitName PreProc
+hi def link sdKey Statement
+hi def link sdValue Constant
+hi def link sdSymbol Special
+
+" It'd be nice if this worked..
+"syn match sdSymbol /.\+/ contained containedin=sd.\+Flag
+"syn match sdKey /.\+/ contained containedin=sd.\+Key
+
+hi def link sdUnitKey sdKey
+hi def link sdInstallKey sdKey
+hi def link sdExecKey sdKey
+hi def link sdKillKey sdKey
+hi def link sdSocketKey sdKey
+hi def link sdServiceKey sdKey
+hi def link sdServiceCommonKey sdKey
+hi def link sdTimerKey sdKey
+hi def link sdMountKey sdKey
+hi def link sdAutomountKey sdKey
+hi def link sdSwapKey sdKey
+hi def link sdPathKey sdKey
+
+hi def link sdInt sdValue
+hi def link sdBool sdValue
+hi def link sdOctal sdValue
+hi def link sdDuration sdValue
+hi def link sdVirtType sdValue
+hi def link sdServiceType sdValue
+hi def link sdNotifyType sdValue
+hi def link sdSecurityType sdValue
+hi def link sdSecureBits sdValue
+hi def link sdMountFlags sdValue
+hi def link sdKillMode sdValue
+hi def link sdRestartType sdValue
+hi def link sdSignal sdValue
+hi def link sdStdin sdValue
+hi def link sdStdout sdValue
+hi def link sdSyslogFacil sdValue
+hi def link sdSyslogLevel sdValue
+hi def link sdIOSched sdValue
+hi def link sdCPUSched sdValue
+hi def link sdRlimit sdValue
+
+hi def link sdExecFlag sdSymbol
+hi def link sdConditionFlag sdSymbol
+hi def link sdEnvDashFlag sdSymbol
+
+let b:current_syntax = "systemd"