upstart.vim 3.1 KB

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