xref: /vim-8.2.3635/runtime/syntax/inittab.vim (revision 403f3eb4)
1" Vim syntax file
2" Language: SysV-compatible init process control file `inittab'
3" Maintainer: Donovan Keohane <[email protected]>
4" Previous Maintainer: David Ne\v{c}as (Yeti) <[email protected]>
5" Last Change: 2019-11-19
6
7" Setup
8" quit when a syntax file was already loaded
9if exists("b:current_syntax")
10  finish
11endif
12
13syn case match
14
15" Base constructs
16syn match inittabError "[^:]\+:"me=e-1 contained
17syn match inittabError "[^:]\+$" contained
18syn match inittabComment "^[#:].*$" contains=inittabFixme
19syn match inittabComment "#.*$" contained contains=inittabFixme
20syn keyword inittabFixme FIXME TODO XXX NOT
21
22" Shell
23syn region inittabShString start=+"+ end=+"+ skip=+\\\\\|\\\"+ contained
24syn region inittabShString start=+'+ end=+'+ contained
25syn match inittabShOption "\s[-+][[:alnum:]]\+"ms=s+1 contained
26syn match inittabShOption "\s--[:alnum:][-[:alnum:]]*"ms=s+1 contained
27syn match inittabShCommand "\S\+" contained
28syn cluster inittabSh add=inittabShOption,inittabShString,inittabShCommand
29
30" Keywords
31syn keyword inittabActionName respawn wait once boot bootwait off ondemand sysinit powerwait powerfail powerokwait powerfailnow ctrlaltdel kbrequest initdefault contained
32
33" Line parser
34syn match inittabId "^[[:alnum:]~]\{1,4}" nextgroup=inittabColonRunLevels,inittabError
35syn match inittabColonRunLevels ":" contained nextgroup=inittabRunLevels,inittabColonAction,inittabError
36syn match inittabRunLevels "[0-6A-Ca-cSs]\+" contained nextgroup=inittabColonAction,inittabError
37syn match inittabColonAction ":" contained nextgroup=inittabAction,inittabError
38syn match inittabAction "\w\+" contained nextgroup=inittabColonProcess,inittabError contains=inittabActionName
39syn match inittabColonProcess ":" contained nextgroup=inittabProcessPlus,inittabProcess,inittabError
40syn match inittabProcessPlus "+" contained nextgroup=inittabProcess,inittabError
41syn region inittabProcess start="\S" end="$" transparent oneline contained contains=@inittabSh,inittabComment
42
43" Define the default highlighting
44
45hi def link inittabComment Comment
46hi def link inittabFixme Todo
47hi def link inittabActionName Type
48hi def link inittabError Error
49hi def link inittabId Identifier
50hi def link inittabRunLevels Special
51
52hi def link inittabColonProcess inittabColon
53hi def link inittabColonAction inittabColon
54hi def link inittabColonRunLevels inittabColon
55hi def link inittabColon PreProc
56
57hi def link inittabShString String
58hi def link inittabShOption Special
59hi def link inittabShCommand Statement
60
61
62let b:current_syntax = "inittab"
63