375
|
1 " Vim syntax file
|
11062
|
2 " Language: pam(8) configuration file
|
|
3 " Previous Maintainer: Nikolai Weibull <now@bitwi.se>
|
21676
|
4 " Latest Revision: 2020/08/04
|
|
5 " Changes By: Haochen Tong
|
375
|
6
|
|
7
|
|
8 if exists("b:current_syntax")
|
|
9 finish
|
|
10 endif
|
|
11
|
|
12 let s:cpo_save = &cpo
|
|
13 set cpo&vim
|
|
14
|
21676
|
15 let s:has_service_field = exists("b:pamconf_has_service_field")
|
|
16 \ ? b:pamconf_has_service_field
|
|
17 \ : expand('%:t') == 'pam.conf' ? 1 : 0
|
|
18
|
|
19 syn match pamconfType '-\?[[:alpha:]]\+'
|
|
20 \ contains=pamconfTypeKeyword
|
|
21 \ nextgroup=pamconfControl,
|
|
22 \ pamconfTypeLineCont skipwhite
|
|
23
|
|
24 syn keyword pamconfTypeKeyword contained account auth password session
|
|
25
|
|
26 if s:has_service_field
|
|
27 syn match pamconfService '^[[:graph:]]\+'
|
|
28 \ nextgroup=pamconfType,
|
|
29 \ pamconfServiceLineCont skipwhite
|
|
30
|
|
31 syn match pamconfServiceLineCont contained '\\$'
|
|
32 \ nextgroup=pamconfType,
|
|
33 \ pamconfServiceLineCont skipwhite skipnl
|
|
34 endif
|
375
|
35
|
|
36 syn keyword pamconfTodo contained TODO FIXME XXX NOTE
|
|
37
|
|
38 syn region pamconfComment display oneline start='#' end='$'
|
|
39 \ contains=pamconfTodo,@Spell
|
|
40
|
|
41 syn match pamconfTypeLineCont contained '\\$'
|
|
42 \ nextgroup=pamconfControl,
|
|
43 \ pamconfTypeLineCont skipwhite skipnl
|
|
44
|
|
45 syn keyword pamconfControl contained requisite required sufficient
|
3082
|
46 \ optional include substack
|
375
|
47 \ nextgroup=pamconfMPath,
|
|
48 \ pamconfControlLineContH skipwhite
|
|
49
|
|
50 syn match pamconfControlBegin '\[' nextgroup=pamconfControlValues,
|
|
51 \ pamconfControlLineCont skipwhite
|
|
52
|
|
53 syn match pamconfControlLineCont contained '\\$'
|
|
54 \ nextgroup=pamconfControlValues,
|
|
55 \ pamconfControlLineCont skipwhite skipnl
|
|
56
|
|
57 syn keyword pamconfControlValues contained success open_err symbol_err
|
|
58 \ service_err system_err buf_err
|
|
59 \ perm_denied auth_err cred_insufficient
|
|
60 \ authinfo_unavail user_unknown maxtries
|
|
61 \ new_authtok_reqd acct_expired session_err
|
|
62 \ cred_unavail cred_expired cred_err
|
|
63 \ no_module_data conv_err authtok_err
|
|
64 \ authtok_recover_err authtok_lock_busy
|
|
65 \ authtok_disable_aging try_again ignore
|
|
66 \ abort authtok_expired module_unknown
|
|
67 \ bad_item and default
|
|
68 \ nextgroup=pamconfControlValueEq
|
|
69
|
3082
|
70 syn match pamconfControlValueEq contained '='
|
|
71 \ nextgroup=pamconfControlActionN,
|
|
72 \ pamconfControlAction
|
375
|
73
|
|
74 syn match pamconfControlActionN contained '\d\+\>'
|
|
75 \ nextgroup=pamconfControlValues,
|
|
76 \ pamconfControlLineCont,pamconfControlEnd
|
|
77 \ skipwhite
|
|
78 syn keyword pamconfControlAction contained ignore bad die ok done reset
|
|
79 \ nextgroup=pamconfControlValues,
|
|
80 \ pamconfControlLineCont,pamconfControlEnd
|
|
81 \ skipwhite
|
|
82
|
|
83 syn match pamconfControlEnd contained '\]'
|
|
84 \ nextgroup=pamconfMPath,
|
|
85 \ pamconfControlLineContH skipwhite
|
|
86
|
|
87 syn match pamconfControlLineContH contained '\\$'
|
|
88 \ nextgroup=pamconfMPath,
|
|
89 \ pamconfControlLineContH skipwhite skipnl
|
|
90
|
|
91 syn match pamconfMPath contained '\S\+'
|
|
92 \ nextgroup=pamconfMPathLineCont,
|
|
93 \ pamconfArgs skipwhite
|
|
94
|
|
95 syn match pamconfArgs contained '\S\+'
|
|
96 \ nextgroup=pamconfArgsLineCont,
|
|
97 \ pamconfArgs skipwhite
|
|
98
|
|
99 syn match pamconfMPathLineCont contained '\\$'
|
|
100 \ nextgroup=pamconfMPathLineCont,
|
|
101 \ pamconfArgs skipwhite skipnl
|
|
102
|
|
103 syn match pamconfArgsLineCont contained '\\$'
|
|
104 \ nextgroup=pamconfArgsLineCont,
|
|
105 \ pamconfArgs skipwhite skipnl
|
|
106
|
|
107 hi def link pamconfTodo Todo
|
|
108 hi def link pamconfComment Comment
|
|
109 hi def link pamconfService Statement
|
|
110 hi def link pamconfServiceLineCont Special
|
21676
|
111 hi def link pamconfType Special
|
|
112 hi def link pamconfTypeKeyword Type
|
375
|
113 hi def link pamconfTypeLineCont pamconfServiceLineCont
|
|
114 hi def link pamconfControl Macro
|
|
115 hi def link pamconfControlBegin Delimiter
|
|
116 hi def link pamconfControlLineContH pamconfServiceLineCont
|
|
117 hi def link pamconfControlLineCont pamconfServiceLineCont
|
|
118 hi def link pamconfControlValues Identifier
|
|
119 hi def link pamconfControlValueEq Operator
|
|
120 hi def link pamconfControlActionN Number
|
|
121 hi def link pamconfControlAction Identifier
|
|
122 hi def link pamconfControlEnd Delimiter
|
|
123 hi def link pamconfMPath String
|
|
124 hi def link pamconfMPathLineCont pamconfServiceLineCont
|
|
125 hi def link pamconfArgs Normal
|
|
126 hi def link pamconfArgsLineCont pamconfServiceLineCont
|
|
127
|
|
128 let b:current_syntax = "pamconf"
|
|
129
|
|
130 let &cpo = s:cpo_save
|
|
131 unlet s:cpo_save
|