1" Vim syntax file 2" Language: Upstart job files 3" Maintainer: Michael Biebl <[email protected]> 4" James Hunt <[email protected]> 5" Last Change: 2012 Jan 16 6" License: The Vim license 7" Version: 0.4 8" Remark: Syntax highlighting for Upstart (init(8)) job files. 9" 10" It is inspired by the initng syntax file and includes sh.vim to do the 11" highlighting of script blocks. 12 13if version < 600 14 syntax clear 15elseif exists("b:current_syntax") 16 finish 17endif 18 19let is_bash = 1 20syn include @Shell syntax/sh.vim 21 22syn case match 23 24" avoid need to use 'match' for most events 25setlocal iskeyword+=- 26 27syn match upstartComment /#.*$/ contains=upstartTodo 28syn keyword upstartTodo TODO FIXME contained 29 30syn region upstartString start=/"/ end=/"/ skip=/\\"/ 31 32syn region upstartScript matchgroup=upstartStatement start="script" end="end script" contains=@upstartShellCluster 33 34syn cluster upstartShellCluster contains=@Shell 35 36" one argument 37syn keyword upstartStatement description author version instance expect 38syn keyword upstartStatement pid kill normal console env exit export 39syn keyword upstartStatement umask nice oom chroot chdir exec 40 41" two arguments 42syn keyword upstartStatement limit 43 44" one or more arguments (events) 45syn keyword upstartStatement emits 46 47syn keyword upstartStatement on start stop 48 49" flag, no parameter 50syn keyword upstartStatement respawn service instance manual debug task 51 52" prefix for exec or script 53syn keyword upstartOption pre-start post-start pre-stop post-stop 54 55" option for kill 56syn keyword upstartOption timeout 57" option for oom 58syn keyword upstartOption never 59" options for console 60syn keyword upstartOption output owner 61" options for expect 62syn keyword upstartOption fork daemon 63" options for limit 64syn keyword upstartOption unlimited 65 66" 'options' for start/stop on 67syn keyword upstartOption and or 68 69" Upstart itself and associated utilities 70syn keyword upstartEvent runlevel 71syn keyword upstartEvent started 72syn keyword upstartEvent starting 73syn keyword upstartEvent startup 74syn keyword upstartEvent stopped 75syn keyword upstartEvent stopping 76syn keyword upstartEvent control-alt-delete 77syn keyword upstartEvent keyboard-request 78syn keyword upstartEvent power-status-changed 79 80" D-Bus 81syn keyword upstartEvent dbus-activation 82 83" Display Manager (ie gdm) 84syn keyword upstartEvent desktop-session-start 85syn keyword upstartEvent login-session-start 86 87" mountall 88syn keyword upstartEvent all-swaps 89syn keyword upstartEvent filesystem 90syn keyword upstartEvent mounted 91syn keyword upstartEvent mounting 92syn keyword upstartEvent local-filesystems 93syn keyword upstartEvent remote-filesystems 94syn keyword upstartEvent virtual-filesystems 95 96" SysV umountnfs.sh 97syn keyword upstartEvent mounted-remote-filesystems 98 99" upstart-udev-bridge and ifup/down 100syn match upstartEvent /\<\i\{-1,}-device-\(added\|removed\|up\|down\)/ 101 102" upstart-socket-bridge 103syn keyword upstartEvent socket 104 105hi def link upstartComment Comment 106hi def link upstartTodo Todo 107hi def link upstartString String 108hi def link upstartStatement Statement 109hi def link upstartOption Type 110hi def link upstartEvent Define 111 112let b:current_syntax = "upstart" 113