Mercurial > vim
annotate runtime/syntax/pamconf.vim @ 34700:24fb114b2f2c
runtime(pamconf): add support for Debian specific @includes
Commit: https://github.com/vim/vim/commit/807fff135d52fe8e6e799b78b80cccb299d246a9
Author: Christian Brabandt <cb@256bit.org>
Date: Sun Mar 31 18:04:21 2024 +0200
runtime(pamconf): add support for Debian specific @includes
fixes: https://github.com/vim/vim/issues/14335
Signed-off-by: Christian Brabandt <cb@256bit.org>
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sun, 31 Mar 2024 18:15:02 +0200 |
parents | 1b345fb68ae3 |
children |
rev | line source |
---|---|
375 | 1 " Vim syntax file |
11062 | 2 " Language: pam(8) configuration file |
3 " Previous Maintainer: Nikolai Weibull <now@bitwi.se> | |
34700
24fb114b2f2c
runtime(pamconf): add support for Debian specific @includes
Christian Brabandt <cb@256bit.org>
parents:
21676
diff
changeset
|
4 " Latest Change: 2024/03/31 |
21676 | 5 " Changes By: Haochen Tong |
34700
24fb114b2f2c
runtime(pamconf): add support for Debian specific @includes
Christian Brabandt <cb@256bit.org>
parents:
21676
diff
changeset
|
6 " Vim Project for the @include syntax |
375 | 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 | |
34700
24fb114b2f2c
runtime(pamconf): add support for Debian specific @includes
Christian Brabandt <cb@256bit.org>
parents:
21676
diff
changeset
|
26 " The @include syntax is Debian specific |
24fb114b2f2c
runtime(pamconf): add support for Debian specific @includes
Christian Brabandt <cb@256bit.org>
parents:
21676
diff
changeset
|
27 syn match pamconfInclude '^@include' |
24fb114b2f2c
runtime(pamconf): add support for Debian specific @includes
Christian Brabandt <cb@256bit.org>
parents:
21676
diff
changeset
|
28 \ nextgroup=pamconfIncludeFile |
24fb114b2f2c
runtime(pamconf): add support for Debian specific @includes
Christian Brabandt <cb@256bit.org>
parents:
21676
diff
changeset
|
29 \ skipwhite |
24fb114b2f2c
runtime(pamconf): add support for Debian specific @includes
Christian Brabandt <cb@256bit.org>
parents:
21676
diff
changeset
|
30 |
24fb114b2f2c
runtime(pamconf): add support for Debian specific @includes
Christian Brabandt <cb@256bit.org>
parents:
21676
diff
changeset
|
31 syn match pamconfIncludeFile '\f\+$' |
24fb114b2f2c
runtime(pamconf): add support for Debian specific @includes
Christian Brabandt <cb@256bit.org>
parents:
21676
diff
changeset
|
32 |
21676 | 33 if s:has_service_field |
34 syn match pamconfService '^[[:graph:]]\+' | |
35 \ nextgroup=pamconfType, | |
36 \ pamconfServiceLineCont skipwhite | |
37 | |
38 syn match pamconfServiceLineCont contained '\\$' | |
39 \ nextgroup=pamconfType, | |
40 \ pamconfServiceLineCont skipwhite skipnl | |
41 endif | |
375 | 42 |
43 syn keyword pamconfTodo contained TODO FIXME XXX NOTE | |
44 | |
45 syn region pamconfComment display oneline start='#' end='$' | |
46 \ contains=pamconfTodo,@Spell | |
47 | |
48 syn match pamconfTypeLineCont contained '\\$' | |
49 \ nextgroup=pamconfControl, | |
50 \ pamconfTypeLineCont skipwhite skipnl | |
51 | |
52 syn keyword pamconfControl contained requisite required sufficient | |
3082 | 53 \ optional include substack |
375 | 54 \ nextgroup=pamconfMPath, |
55 \ pamconfControlLineContH skipwhite | |
56 | |
57 syn match pamconfControlBegin '\[' nextgroup=pamconfControlValues, | |
58 \ pamconfControlLineCont skipwhite | |
59 | |
60 syn match pamconfControlLineCont contained '\\$' | |
61 \ nextgroup=pamconfControlValues, | |
62 \ pamconfControlLineCont skipwhite skipnl | |
63 | |
64 syn keyword pamconfControlValues contained success open_err symbol_err | |
65 \ service_err system_err buf_err | |
66 \ perm_denied auth_err cred_insufficient | |
67 \ authinfo_unavail user_unknown maxtries | |
68 \ new_authtok_reqd acct_expired session_err | |
69 \ cred_unavail cred_expired cred_err | |
70 \ no_module_data conv_err authtok_err | |
71 \ authtok_recover_err authtok_lock_busy | |
72 \ authtok_disable_aging try_again ignore | |
73 \ abort authtok_expired module_unknown | |
74 \ bad_item and default | |
75 \ nextgroup=pamconfControlValueEq | |
76 | |
3082 | 77 syn match pamconfControlValueEq contained '=' |
78 \ nextgroup=pamconfControlActionN, | |
79 \ pamconfControlAction | |
375 | 80 |
81 syn match pamconfControlActionN contained '\d\+\>' | |
82 \ nextgroup=pamconfControlValues, | |
83 \ pamconfControlLineCont,pamconfControlEnd | |
84 \ skipwhite | |
85 syn keyword pamconfControlAction contained ignore bad die ok done reset | |
86 \ nextgroup=pamconfControlValues, | |
87 \ pamconfControlLineCont,pamconfControlEnd | |
88 \ skipwhite | |
89 | |
90 syn match pamconfControlEnd contained '\]' | |
91 \ nextgroup=pamconfMPath, | |
92 \ pamconfControlLineContH skipwhite | |
93 | |
94 syn match pamconfControlLineContH contained '\\$' | |
95 \ nextgroup=pamconfMPath, | |
96 \ pamconfControlLineContH skipwhite skipnl | |
97 | |
98 syn match pamconfMPath contained '\S\+' | |
99 \ nextgroup=pamconfMPathLineCont, | |
100 \ pamconfArgs skipwhite | |
101 | |
102 syn match pamconfArgs contained '\S\+' | |
103 \ nextgroup=pamconfArgsLineCont, | |
104 \ pamconfArgs skipwhite | |
105 | |
106 syn match pamconfMPathLineCont contained '\\$' | |
107 \ nextgroup=pamconfMPathLineCont, | |
108 \ pamconfArgs skipwhite skipnl | |
109 | |
110 syn match pamconfArgsLineCont contained '\\$' | |
111 \ nextgroup=pamconfArgsLineCont, | |
112 \ pamconfArgs skipwhite skipnl | |
113 | |
114 hi def link pamconfTodo Todo | |
115 hi def link pamconfComment Comment | |
116 hi def link pamconfService Statement | |
117 hi def link pamconfServiceLineCont Special | |
21676 | 118 hi def link pamconfType Special |
119 hi def link pamconfTypeKeyword Type | |
375 | 120 hi def link pamconfTypeLineCont pamconfServiceLineCont |
121 hi def link pamconfControl Macro | |
122 hi def link pamconfControlBegin Delimiter | |
123 hi def link pamconfControlLineContH pamconfServiceLineCont | |
124 hi def link pamconfControlLineCont pamconfServiceLineCont | |
125 hi def link pamconfControlValues Identifier | |
126 hi def link pamconfControlValueEq Operator | |
127 hi def link pamconfControlActionN Number | |
128 hi def link pamconfControlAction Identifier | |
129 hi def link pamconfControlEnd Delimiter | |
130 hi def link pamconfMPath String | |
131 hi def link pamconfMPathLineCont pamconfServiceLineCont | |
132 hi def link pamconfArgs Normal | |
133 hi def link pamconfArgsLineCont pamconfServiceLineCont | |
34700
24fb114b2f2c
runtime(pamconf): add support for Debian specific @includes
Christian Brabandt <cb@256bit.org>
parents:
21676
diff
changeset
|
134 hi def link pamconfInclude Include |
24fb114b2f2c
runtime(pamconf): add support for Debian specific @includes
Christian Brabandt <cb@256bit.org>
parents:
21676
diff
changeset
|
135 hi def link pamconfIncludeFile Include |
375 | 136 |
137 let b:current_syntax = "pamconf" | |
138 | |
139 let &cpo = s:cpo_save | |
140 unlet s:cpo_save |