2 " Language: SysV-compatible init process control file `inittab'
3 " Maintainer: David Ne\v{c}as (Yeti), <yeti@physics.muni.cz>
4 " Last Change: 2001-05-13
5 " URI: http://physics.muni.cz/~yeti/download/inittab.vim
7 " Notes: In fact this file is made to work with Linux's init v2.78, which is
9 " The inittab file format is quite strict, so we highlight everything
10 " not recognized as an error---please report problems.
13 " React to possibly already-defined syntax.
14 " For version 5.x: Clear all syntax items unconditionally
15 " For version 6.x: Quit when a syntax file was already loaded
17 if exists("b:current_syntax")
27 syn match inittabError "[^:]\+:"me=e-1 contained
28 syn match inittabError "[^:]\+$" contained
29 " On AIX, `:' at a begin of line acts a comment char (braindead)
30 syn match inittabComment "^[#:].*$" contains=inittabFixme
31 syn match inittabComment "#.*$" contained contains=inittabFixme
32 syn keyword inittabFixme FIXME TODO XXX NOT
35 syn region inittabShString start=+"+ end=+"+ skip=+\\\\\|\\\"+ contained
36 syn region inittabShString start=+'+ end=+'+ contained
37 syn match inittabShOption "\s[-+][[:alnum:]]\+"ms=s+1 contained
38 syn match inittabShOption "\s--[:alnum:][-[:alnum:]]*"ms=s+1 contained
39 syn match inittabShCommand "/\S\+" contained
40 syn cluster inittabSh add=inittabShOption,inittabShString,inittabShCommand
43 syn keyword inittabActionName respawn wait once boot bottwait off ondemand sysinit powerwait powerfail powerokwait powerfailnow ctrlaltdel kbrequest initdefault contained
46 syn match inittabId "^[[:alnum:]~]\{1,4}" nextgroup=inittabColonRunLevels,inittabError
47 syn match inittabColonRunLevels ":" contained nextgroup=inittabRunLevels,inittabColonAction,inittabError
48 syn match inittabRunLevels "[0-6A-Ca-cSs]\+" contained nextgroup=inittabColonAction,inittabError
49 syn match inittabColonAction ":" contained nextgroup=inittabAction,inittabError
50 syn match inittabAction "\w\+" contained nextgroup=inittabColonProcess,inittabError contains=inittabActionName
51 syn match inittabColonProcess ":" contained nextgroup=inittabProcessPlus,inittabProcess,inittabError
52 syn match inittabProcessPlus "+" contained nextgroup=inittabProcess,inittabError
53 syn region inittabProcess start="/" end="$" transparent oneline contained contains=@inittabSh,inittabComment
55 " Define the default highlighting {{{
56 " For version 5.7 and earlier: Only when not done already
57 " For version 5.8 and later: Only when an item doesn't have highlighting yet
58 if version >= 508 || !exists("did_apache_syntax_inits")
60 let did_apache_syntax_inits = 1
61 command -nargs=+ HiLink hi link <args>
63 command -nargs=+ HiLink hi def link <args>
66 HiLink inittabComment Comment
67 HiLink inittabFixme Todo
68 HiLink inittabActionName Type
69 HiLink inittabError Error
70 HiLink inittabId Identifier
71 HiLink inittabRunLevels Special
73 HiLink inittabColonProcess inittabColon
74 HiLink inittabColonAction inittabColon
75 HiLink inittabColonRunLevels inittabColon
76 HiLink inittabColon PreProc
78 HiLink inittabShString String
79 HiLink inittabShOption Special
80 HiLink inittabShCommand Statement
85 let b:current_syntax = "inittab"