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