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