Bram Moolenaar | 1cd871b | 2004-12-19 22:46:22 +0000 | [diff] [blame] | 1 | " Vim syntax file |
Bram Moolenaar | 214641f | 2017-03-05 17:04:09 +0100 | [diff] [blame] | 2 | " Language: sudoers(5) configuration files |
Bram Moolenaar | dad4473 | 2021-03-31 20:07:33 +0200 | [diff] [blame] | 3 | " Maintainer: Eisuke Kawashima ( e.kawaschima+vim AT gmail.com ) |
Bram Moolenaar | 214641f | 2017-03-05 17:04:09 +0100 | [diff] [blame] | 4 | " Previous Maintainer: Nikolai Weibull <now@bitwi.se> |
Bram Moolenaar | dad4473 | 2021-03-31 20:07:33 +0200 | [diff] [blame] | 5 | " Latest Revision: 2021 Mar 15 |
Bram Moolenaar | a9604e6 | 2018-07-21 05:56:22 +0200 | [diff] [blame] | 6 | " Recent Changes: Support for #include and #includedir. |
Bram Moolenaar | fc65cab | 2018-08-28 22:58:02 +0200 | [diff] [blame] | 7 | " Added many new options (Samuel D. Leslie) |
Bram Moolenaar | 1cd871b | 2004-12-19 22:46:22 +0000 | [diff] [blame] | 8 | |
Bram Moolenaar | 42eeac3 | 2005-06-29 22:40:58 +0000 | [diff] [blame] | 9 | if exists("b:current_syntax") |
Bram Moolenaar | 1cd871b | 2004-12-19 22:46:22 +0000 | [diff] [blame] | 10 | finish |
| 11 | endif |
| 12 | |
Bram Moolenaar | 42eeac3 | 2005-06-29 22:40:58 +0000 | [diff] [blame] | 13 | let s:cpo_save = &cpo |
| 14 | set cpo&vim |
| 15 | |
Bram Moolenaar | 1cd871b | 2004-12-19 22:46:22 +0000 | [diff] [blame] | 16 | " TODO: instead of 'skipnl', we would like to match a specific group that would |
| 17 | " match \\$ and then continue with the nextgroup, actually, the skipnl doesn't |
| 18 | " work... |
| 19 | " TODO: treat 'ALL' like a special (yay, a bundle of new rules!!!) |
| 20 | |
Bram Moolenaar | 1cd871b | 2004-12-19 22:46:22 +0000 | [diff] [blame] | 21 | syn match sudoersUserSpec '^' nextgroup=@sudoersUserInSpec skipwhite |
| 22 | |
Bram Moolenaar | 42eeac3 | 2005-06-29 22:40:58 +0000 | [diff] [blame] | 23 | syn match sudoersSpecEquals contained '=' nextgroup=@sudoersCmndSpecList skipwhite |
Bram Moolenaar | 1cd871b | 2004-12-19 22:46:22 +0000 | [diff] [blame] | 24 | |
Bram Moolenaar | 42eeac3 | 2005-06-29 22:40:58 +0000 | [diff] [blame] | 25 | syn cluster sudoersCmndSpecList contains=sudoersUserRunasBegin,sudoersPASSWD,@sudoersCmndInSpec |
Bram Moolenaar | 1cd871b | 2004-12-19 22:46:22 +0000 | [diff] [blame] | 26 | |
Bram Moolenaar | 42eeac3 | 2005-06-29 22:40:58 +0000 | [diff] [blame] | 27 | syn keyword sudoersTodo contained TODO FIXME XXX NOTE |
Bram Moolenaar | 1cd871b | 2004-12-19 22:46:22 +0000 | [diff] [blame] | 28 | |
Bram Moolenaar | 0dc065e | 2005-07-04 22:49:24 +0000 | [diff] [blame] | 29 | syn region sudoersComment display oneline start='#' end='$' contains=sudoersTodo |
Bram Moolenaar | dad4473 | 2021-03-31 20:07:33 +0200 | [diff] [blame] | 30 | syn region sudoersInclude display oneline start='[#@]\%(include\|includedir\)\>' end='$' |
Bram Moolenaar | 1cd871b | 2004-12-19 22:46:22 +0000 | [diff] [blame] | 31 | |
Bram Moolenaar | 42eeac3 | 2005-06-29 22:40:58 +0000 | [diff] [blame] | 32 | syn keyword sudoersAlias User_Alias Runas_Alias nextgroup=sudoersUserAlias skipwhite skipnl |
| 33 | syn keyword sudoersAlias Host_Alias nextgroup=sudoersHostAlias skipwhite skipnl |
| 34 | syn keyword sudoersAlias Cmnd_Alias nextgroup=sudoersCmndAlias skipwhite skipnl |
Bram Moolenaar | 1cd871b | 2004-12-19 22:46:22 +0000 | [diff] [blame] | 35 | |
Bram Moolenaar | 42eeac3 | 2005-06-29 22:40:58 +0000 | [diff] [blame] | 36 | syn match sudoersUserAlias contained '\<\u[A-Z0-9_]*\>' nextgroup=sudoersUserAliasEquals skipwhite skipnl |
| 37 | syn match sudoersUserNameInList contained '\<\l\+\>' nextgroup=@sudoersUserList skipwhite skipnl |
| 38 | syn match sudoersUIDInList contained '#\d\+\>' nextgroup=@sudoersUserList skipwhite skipnl |
| 39 | syn match sudoersGroupInList contained '%\l\+\>' nextgroup=@sudoersUserList skipwhite skipnl |
| 40 | syn match sudoersUserNetgroupInList contained '+\l\+\>' nextgroup=@sudoersUserList skipwhite skipnl |
| 41 | syn match sudoersUserAliasInList contained '\<\u[A-Z0-9_]*\>' nextgroup=@sudoersUserList skipwhite skipnl |
Bram Moolenaar | 1cd871b | 2004-12-19 22:46:22 +0000 | [diff] [blame] | 42 | |
Bram Moolenaar | 42eeac3 | 2005-06-29 22:40:58 +0000 | [diff] [blame] | 43 | syn match sudoersUserName contained '\<\l\+\>' nextgroup=@sudoersParameter skipwhite skipnl |
| 44 | syn match sudoersUID contained '#\d\+\>' nextgroup=@sudoersParameter skipwhite skipnl |
| 45 | syn match sudoersGroup contained '%\l\+\>' nextgroup=@sudoersParameter skipwhite skipnl |
| 46 | syn match sudoersUserNetgroup contained '+\l\+\>' nextgroup=@sudoersParameter skipwhite skipnl |
| 47 | syn match sudoersUserAliasRef contained '\<\u[A-Z0-9_]*\>' nextgroup=@sudoersParameter skipwhite skipnl |
Bram Moolenaar | 1cd871b | 2004-12-19 22:46:22 +0000 | [diff] [blame] | 48 | |
Bram Moolenaar | 42eeac3 | 2005-06-29 22:40:58 +0000 | [diff] [blame] | 49 | syn match sudoersUserNameInSpec contained '\<\l\+\>' nextgroup=@sudoersUserSpec skipwhite skipnl |
| 50 | syn match sudoersUIDInSpec contained '#\d\+\>' nextgroup=@sudoersUserSpec skipwhite skipnl |
| 51 | syn match sudoersGroupInSpec contained '%\l\+\>' nextgroup=@sudoersUserSpec skipwhite skipnl |
| 52 | syn match sudoersUserNetgroupInSpec contained '+\l\+\>' nextgroup=@sudoersUserSpec skipwhite skipnl |
| 53 | syn match sudoersUserAliasInSpec contained '\<\u[A-Z0-9_]*\>' nextgroup=@sudoersUserSpec skipwhite skipnl |
Bram Moolenaar | 1cd871b | 2004-12-19 22:46:22 +0000 | [diff] [blame] | 54 | |
Bram Moolenaar | 42eeac3 | 2005-06-29 22:40:58 +0000 | [diff] [blame] | 55 | syn match sudoersUserNameInRunas contained '\<\l\+\>' nextgroup=@sudoersUserRunas skipwhite skipnl |
| 56 | syn match sudoersUIDInRunas contained '#\d\+\>' nextgroup=@sudoersUserRunas skipwhite skipnl |
| 57 | syn match sudoersGroupInRunas contained '%\l\+\>' nextgroup=@sudoersUserRunas skipwhite skipnl |
| 58 | syn match sudoersUserNetgroupInRunas contained '+\l\+\>' nextgroup=@sudoersUserRunas skipwhite skipnl |
| 59 | syn match sudoersUserAliasInRunas contained '\<\u[A-Z0-9_]*\>' nextgroup=@sudoersUserRunas skipwhite skipnl |
Bram Moolenaar | 1cd871b | 2004-12-19 22:46:22 +0000 | [diff] [blame] | 60 | |
Bram Moolenaar | 42eeac3 | 2005-06-29 22:40:58 +0000 | [diff] [blame] | 61 | syn match sudoersHostAlias contained '\<\u[A-Z0-9_]*\>' nextgroup=sudoersHostAliasEquals skipwhite skipnl |
| 62 | syn match sudoersHostNameInList contained '\<\l\+\>' nextgroup=@sudoersHostList skipwhite skipnl |
| 63 | syn match sudoersIPAddrInList contained '\%(\d\{1,3}\.\)\{3}\d\{1,3}' nextgroup=@sudoersHostList skipwhite skipnl |
Bram Moolenaar | 1cd871b | 2004-12-19 22:46:22 +0000 | [diff] [blame] | 64 | syn match sudoersNetworkInList contained '\%(\d\{1,3}\.\)\{3}\d\{1,3}\%(/\%(\%(\d\{1,3}\.\)\{3}\d\{1,3}\|\d\+\)\)\=' nextgroup=@sudoersHostList skipwhite skipnl |
Bram Moolenaar | 42eeac3 | 2005-06-29 22:40:58 +0000 | [diff] [blame] | 65 | syn match sudoersHostNetgroupInList contained '+\l\+\>' nextgroup=@sudoersHostList skipwhite skipnl |
| 66 | syn match sudoersHostAliasInList contained '\<\u[A-Z0-9_]*\>' nextgroup=@sudoersHostList skipwhite skipnl |
Bram Moolenaar | 1cd871b | 2004-12-19 22:46:22 +0000 | [diff] [blame] | 67 | |
Bram Moolenaar | 42eeac3 | 2005-06-29 22:40:58 +0000 | [diff] [blame] | 68 | syn match sudoersHostName contained '\<\l\+\>' nextgroup=@sudoersParameter skipwhite skipnl |
| 69 | syn match sudoersIPAddr contained '\%(\d\{1,3}\.\)\{3}\d\{1,3}' nextgroup=@sudoersParameter skipwhite skipnl |
| 70 | syn match sudoersNetwork contained '\%(\d\{1,3}\.\)\{3}\d\{1,3}\%(/\%(\%(\d\{1,3}\.\)\{3}\d\{1,3}\|\d\+\)\)\=' nextgroup=@sudoersParameter skipwhite skipnl |
| 71 | syn match sudoersHostNetgroup contained '+\l\+\>' nextgroup=@sudoersParameter skipwhite skipnl |
| 72 | syn match sudoersHostAliasRef contained '\<\u[A-Z0-9_]*\>' nextgroup=@sudoersParameter skipwhite skipnl |
Bram Moolenaar | 1cd871b | 2004-12-19 22:46:22 +0000 | [diff] [blame] | 73 | |
Bram Moolenaar | 42eeac3 | 2005-06-29 22:40:58 +0000 | [diff] [blame] | 74 | syn match sudoersHostNameInSpec contained '\<\l\+\>' nextgroup=@sudoersHostSpec skipwhite skipnl |
| 75 | syn match sudoersIPAddrInSpec contained '\%(\d\{1,3}\.\)\{3}\d\{1,3}' nextgroup=@sudoersHostSpec skipwhite skipnl |
Bram Moolenaar | 1cd871b | 2004-12-19 22:46:22 +0000 | [diff] [blame] | 76 | syn match sudoersNetworkInSpec contained '\%(\d\{1,3}\.\)\{3}\d\{1,3}\%(/\%(\%(\d\{1,3}\.\)\{3}\d\{1,3}\|\d\+\)\)\=' nextgroup=@sudoersHostSpec skipwhite skipnl |
Bram Moolenaar | 42eeac3 | 2005-06-29 22:40:58 +0000 | [diff] [blame] | 77 | syn match sudoersHostNetgroupInSpec contained '+\l\+\>' nextgroup=@sudoersHostSpec skipwhite skipnl |
| 78 | syn match sudoersHostAliasInSpec contained '\<\u[A-Z0-9_]*\>' nextgroup=@sudoersHostSpec skipwhite skipnl |
Bram Moolenaar | 1cd871b | 2004-12-19 22:46:22 +0000 | [diff] [blame] | 79 | |
Bram Moolenaar | 42eeac3 | 2005-06-29 22:40:58 +0000 | [diff] [blame] | 80 | syn match sudoersCmndAlias contained '\<\u[A-Z0-9_]*\>' nextgroup=sudoersCmndAliasEquals skipwhite skipnl |
Bram Moolenaar | 1cd871b | 2004-12-19 22:46:22 +0000 | [diff] [blame] | 81 | syn match sudoersCmndNameInList contained '[^[:space:],:=\\]\+\%(\\[[:space:],:=\\][^[:space:],:=\\]*\)*' nextgroup=@sudoersCmndList,sudoersCommandEmpty,sudoersCommandArgs skipwhite |
Bram Moolenaar | 42eeac3 | 2005-06-29 22:40:58 +0000 | [diff] [blame] | 82 | syn match sudoersCmndAliasInList contained '\<\u[A-Z0-9_]*\>' nextgroup=@sudoersCmndList skipwhite skipnl |
Bram Moolenaar | 1cd871b | 2004-12-19 22:46:22 +0000 | [diff] [blame] | 83 | |
| 84 | syn match sudoersCmndNameInSpec contained '[^[:space:],:=\\]\+\%(\\[[:space:],:=\\][^[:space:],:=\\]*\)*' nextgroup=@sudoersCmndSpec,sudoersCommandEmptyInSpec,sudoersCommandArgsInSpec skipwhite |
Bram Moolenaar | 42eeac3 | 2005-06-29 22:40:58 +0000 | [diff] [blame] | 85 | syn match sudoersCmndAliasInSpec contained '\<\u[A-Z0-9_]*\>' nextgroup=@sudoersCmndSpec skipwhite skipnl |
Bram Moolenaar | 1cd871b | 2004-12-19 22:46:22 +0000 | [diff] [blame] | 86 | |
Bram Moolenaar | 42eeac3 | 2005-06-29 22:40:58 +0000 | [diff] [blame] | 87 | syn match sudoersUserAliasEquals contained '=' nextgroup=@sudoersUserInList skipwhite skipnl |
| 88 | syn match sudoersUserListComma contained ',' nextgroup=@sudoersUserInList skipwhite skipnl |
| 89 | syn match sudoersUserListColon contained ':' nextgroup=sudoersUserAlias skipwhite skipnl |
| 90 | syn cluster sudoersUserList contains=sudoersUserListComma,sudoersUserListColon |
Bram Moolenaar | 1cd871b | 2004-12-19 22:46:22 +0000 | [diff] [blame] | 91 | |
Bram Moolenaar | 42eeac3 | 2005-06-29 22:40:58 +0000 | [diff] [blame] | 92 | syn match sudoersUserSpecComma contained ',' nextgroup=@sudoersUserInSpec skipwhite skipnl |
| 93 | syn cluster sudoersUserSpec contains=sudoersUserSpecComma,@sudoersHostInSpec |
Bram Moolenaar | 1cd871b | 2004-12-19 22:46:22 +0000 | [diff] [blame] | 94 | |
| 95 | syn match sudoersUserRunasBegin contained '(' nextgroup=@sudoersUserInRunas skipwhite skipnl |
Bram Moolenaar | 42eeac3 | 2005-06-29 22:40:58 +0000 | [diff] [blame] | 96 | syn match sudoersUserRunasComma contained ',' nextgroup=@sudoersUserInRunas skipwhite skipnl |
| 97 | syn match sudoersUserRunasEnd contained ')' nextgroup=sudoersPASSWD,@sudoersCmndInSpec skipwhite skipnl |
| 98 | syn cluster sudoersUserRunas contains=sudoersUserRunasComma,@sudoersUserInRunas,sudoersUserRunasEnd |
Bram Moolenaar | 1cd871b | 2004-12-19 22:46:22 +0000 | [diff] [blame] | 99 | |
| 100 | |
Bram Moolenaar | 42eeac3 | 2005-06-29 22:40:58 +0000 | [diff] [blame] | 101 | syn match sudoersHostAliasEquals contained '=' nextgroup=@sudoersHostInList skipwhite skipnl |
| 102 | syn match sudoersHostListComma contained ',' nextgroup=@sudoersHostInList skipwhite skipnl |
| 103 | syn match sudoersHostListColon contained ':' nextgroup=sudoersHostAlias skipwhite skipnl |
| 104 | syn cluster sudoersHostList contains=sudoersHostListComma,sudoersHostListColon |
Bram Moolenaar | 1cd871b | 2004-12-19 22:46:22 +0000 | [diff] [blame] | 105 | |
Bram Moolenaar | 42eeac3 | 2005-06-29 22:40:58 +0000 | [diff] [blame] | 106 | syn match sudoersHostSpecComma contained ',' nextgroup=@sudoersHostInSpec skipwhite skipnl |
| 107 | syn cluster sudoersHostSpec contains=sudoersHostSpecComma,sudoersSpecEquals |
Bram Moolenaar | 1cd871b | 2004-12-19 22:46:22 +0000 | [diff] [blame] | 108 | |
| 109 | |
Bram Moolenaar | 42eeac3 | 2005-06-29 22:40:58 +0000 | [diff] [blame] | 110 | syn match sudoersCmndAliasEquals contained '=' nextgroup=@sudoersCmndInList skipwhite skipnl |
| 111 | syn match sudoersCmndListComma contained ',' nextgroup=@sudoersCmndInList skipwhite skipnl |
| 112 | syn match sudoersCmndListColon contained ':' nextgroup=sudoersCmndAlias skipwhite skipnl |
| 113 | syn cluster sudoersCmndList contains=sudoersCmndListComma,sudoersCmndListColon |
Bram Moolenaar | 1cd871b | 2004-12-19 22:46:22 +0000 | [diff] [blame] | 114 | |
| 115 | syn match sudoersCmndSpecComma contained ',' nextgroup=@sudoersCmndSpecList skipwhite skipnl |
Bram Moolenaar | 42eeac3 | 2005-06-29 22:40:58 +0000 | [diff] [blame] | 116 | syn match sudoersCmndSpecColon contained ':' nextgroup=@sudoersUserInSpec skipwhite skipnl |
| 117 | syn cluster sudoersCmndSpec contains=sudoersCmndSpecComma,sudoersCmndSpecColon |
Bram Moolenaar | 1cd871b | 2004-12-19 22:46:22 +0000 | [diff] [blame] | 118 | |
Bram Moolenaar | 42eeac3 | 2005-06-29 22:40:58 +0000 | [diff] [blame] | 119 | syn cluster sudoersUserInList contains=sudoersUserNegationInList,sudoersUserNameInList,sudoersUIDInList,sudoersGroupInList,sudoersUserNetgroupInList,sudoersUserAliasInList |
| 120 | syn cluster sudoersHostInList contains=sudoersHostNegationInList,sudoersHostNameInList,sudoersIPAddrInList,sudoersNetworkInList,sudoersHostNetgroupInList,sudoersHostAliasInList |
| 121 | syn cluster sudoersCmndInList contains=sudoersCmndNegationInList,sudoersCmndNameInList,sudoersCmndAliasInList |
Bram Moolenaar | 1cd871b | 2004-12-19 22:46:22 +0000 | [diff] [blame] | 122 | |
Bram Moolenaar | 42eeac3 | 2005-06-29 22:40:58 +0000 | [diff] [blame] | 123 | syn cluster sudoersUser contains=sudoersUserNegation,sudoersUserName,sudoersUID,sudoersGroup,sudoersUserNetgroup,sudoersUserAliasRef |
| 124 | syn cluster sudoersHost contains=sudoersHostNegation,sudoersHostName,sudoersIPAddr,sudoersNetwork,sudoersHostNetgroup,sudoersHostAliasRef |
Bram Moolenaar | 1cd871b | 2004-12-19 22:46:22 +0000 | [diff] [blame] | 125 | |
Bram Moolenaar | 42eeac3 | 2005-06-29 22:40:58 +0000 | [diff] [blame] | 126 | syn cluster sudoersUserInSpec contains=sudoersUserNegationInSpec,sudoersUserNameInSpec,sudoersUIDInSpec,sudoersGroupInSpec,sudoersUserNetgroupInSpec,sudoersUserAliasInSpec |
| 127 | syn cluster sudoersHostInSpec contains=sudoersHostNegationInSpec,sudoersHostNameInSpec,sudoersIPAddrInSpec,sudoersNetworkInSpec,sudoersHostNetgroupInSpec,sudoersHostAliasInSpec |
| 128 | syn cluster sudoersUserInRunas contains=sudoersUserNegationInRunas,sudoersUserNameInRunas,sudoersUIDInRunas,sudoersGroupInRunas,sudoersUserNetgroupInRunas,sudoersUserAliasInRunas |
| 129 | syn cluster sudoersCmndInSpec contains=sudoersCmndNegationInSpec,sudoersCmndNameInSpec,sudoersCmndAliasInSpec |
Bram Moolenaar | 1cd871b | 2004-12-19 22:46:22 +0000 | [diff] [blame] | 130 | |
Bram Moolenaar | 1cd871b | 2004-12-19 22:46:22 +0000 | [diff] [blame] | 131 | syn match sudoersUserNegationInList contained '!\+' nextgroup=@sudoersUserInList skipwhite skipnl |
| 132 | syn match sudoersHostNegationInList contained '!\+' nextgroup=@sudoersHostInList skipwhite skipnl |
| 133 | syn match sudoersCmndNegationInList contained '!\+' nextgroup=@sudoersCmndInList skipwhite skipnl |
| 134 | |
Bram Moolenaar | 42eeac3 | 2005-06-29 22:40:58 +0000 | [diff] [blame] | 135 | syn match sudoersUserNegation contained '!\+' nextgroup=@sudoersUser skipwhite skipnl |
| 136 | syn match sudoersHostNegation contained '!\+' nextgroup=@sudoersHost skipwhite skipnl |
Bram Moolenaar | 1cd871b | 2004-12-19 22:46:22 +0000 | [diff] [blame] | 137 | |
| 138 | syn match sudoersUserNegationInSpec contained '!\+' nextgroup=@sudoersUserInSpec skipwhite skipnl |
| 139 | syn match sudoersHostNegationInSpec contained '!\+' nextgroup=@sudoersHostInSpec skipwhite skipnl |
| 140 | syn match sudoersUserNegationInRunas contained '!\+' nextgroup=@sudoersUserInRunas skipwhite skipnl |
| 141 | syn match sudoersCmndNegationInSpec contained '!\+' nextgroup=@sudoersCmndInSpec skipwhite skipnl |
| 142 | |
Bram Moolenaar | 42eeac3 | 2005-06-29 22:40:58 +0000 | [diff] [blame] | 143 | syn match sudoersCommandArgs contained '[^[:space:],:=\\]\+\%(\\[[:space:],:=\\][^[:space:],:=\\]*\)*' nextgroup=sudoersCommandArgs,@sudoersCmndList skipwhite |
| 144 | syn match sudoersCommandEmpty contained '""' nextgroup=@sudoersCmndList skipwhite skipnl |
Bram Moolenaar | 1cd871b | 2004-12-19 22:46:22 +0000 | [diff] [blame] | 145 | |
| 146 | syn match sudoersCommandArgsInSpec contained '[^[:space:],:=\\]\+\%(\\[[:space:],:=\\][^[:space:],:=\\]*\)*' nextgroup=sudoersCommandArgsInSpec,@sudoersCmndSpec skipwhite |
| 147 | syn match sudoersCommandEmptyInSpec contained '""' nextgroup=@sudoersCmndSpec skipwhite skipnl |
| 148 | |
Bram Moolenaar | 42eeac3 | 2005-06-29 22:40:58 +0000 | [diff] [blame] | 149 | syn keyword sudoersDefaultEntry Defaults nextgroup=sudoersDefaultTypeAt,sudoersDefaultTypeColon,sudoersDefaultTypeGreaterThan,@sudoersParameter skipwhite skipnl |
| 150 | syn match sudoersDefaultTypeAt contained '@' nextgroup=@sudoersHost skipwhite skipnl |
| 151 | syn match sudoersDefaultTypeColon contained ':' nextgroup=@sudoersUser skipwhite skipnl |
Bram Moolenaar | 1cd871b | 2004-12-19 22:46:22 +0000 | [diff] [blame] | 152 | syn match sudoersDefaultTypeGreaterThan contained '>' nextgroup=@sudoersUser skipwhite skipnl |
| 153 | |
| 154 | " TODO: could also deal with special characters here |
Bram Moolenaar | 42eeac3 | 2005-06-29 22:40:58 +0000 | [diff] [blame] | 155 | syn match sudoersBooleanParameter contained '!' nextgroup=sudoersBooleanParameter skipwhite skipnl |
Bram Moolenaar | 0065402 | 2011-02-25 14:42:19 +0100 | [diff] [blame] | 156 | syn keyword sudoersBooleanParameter contained skipwhite skipnl |
Bram Moolenaar | fc65cab | 2018-08-28 22:58:02 +0200 | [diff] [blame] | 157 | \ always_query_group_plugin |
Bram Moolenaar | 0065402 | 2011-02-25 14:42:19 +0100 | [diff] [blame] | 158 | \ always_set_home |
| 159 | \ authenticate |
| 160 | \ closefrom_override |
Bram Moolenaar | fc65cab | 2018-08-28 22:58:02 +0200 | [diff] [blame] | 161 | \ compress_io |
Bram Moolenaar | 0065402 | 2011-02-25 14:42:19 +0100 | [diff] [blame] | 162 | \ env_editor |
| 163 | \ env_reset |
Bram Moolenaar | fc65cab | 2018-08-28 22:58:02 +0200 | [diff] [blame] | 164 | \ exec_background |
| 165 | \ fast_glob |
Bram Moolenaar | 0065402 | 2011-02-25 14:42:19 +0100 | [diff] [blame] | 166 | \ fqdn |
Bram Moolenaar | fc65cab | 2018-08-28 22:58:02 +0200 | [diff] [blame] | 167 | \ ignore_audit_errors |
Bram Moolenaar | 0065402 | 2011-02-25 14:42:19 +0100 | [diff] [blame] | 168 | \ ignore_dot |
Bram Moolenaar | fc65cab | 2018-08-28 22:58:02 +0200 | [diff] [blame] | 169 | \ ignore_iolog_errors |
Bram Moolenaar | 0065402 | 2011-02-25 14:42:19 +0100 | [diff] [blame] | 170 | \ ignore_local_sudoers |
Bram Moolenaar | fc65cab | 2018-08-28 22:58:02 +0200 | [diff] [blame] | 171 | \ ignore_logfile_errors |
| 172 | \ ignore_unknown_defaults |
Bram Moolenaar | 0065402 | 2011-02-25 14:42:19 +0100 | [diff] [blame] | 173 | \ insults |
| 174 | \ log_host |
Bram Moolenaar | fc65cab | 2018-08-28 22:58:02 +0200 | [diff] [blame] | 175 | \ log_input |
| 176 | \ log_output |
Bram Moolenaar | 0065402 | 2011-02-25 14:42:19 +0100 | [diff] [blame] | 177 | \ log_year |
| 178 | \ long_otp_prompt |
Bram Moolenaar | fc65cab | 2018-08-28 22:58:02 +0200 | [diff] [blame] | 179 | \ mail_all_cmnds |
Bram Moolenaar | 0065402 | 2011-02-25 14:42:19 +0100 | [diff] [blame] | 180 | \ mail_always |
| 181 | \ mail_badpass |
| 182 | \ mail_no_host |
| 183 | \ mail_no_perms |
| 184 | \ mail_no_user |
Bram Moolenaar | fc65cab | 2018-08-28 22:58:02 +0200 | [diff] [blame] | 185 | \ match_group_by_gid |
| 186 | \ netgroup_tuple |
Bram Moolenaar | 0065402 | 2011-02-25 14:42:19 +0100 | [diff] [blame] | 187 | \ noexec |
Bram Moolenaar | fc65cab | 2018-08-28 22:58:02 +0200 | [diff] [blame] | 188 | \ pam_session |
| 189 | \ pam_setcred |
Bram Moolenaar | 0065402 | 2011-02-25 14:42:19 +0100 | [diff] [blame] | 190 | \ passprompt_override |
Bram Moolenaar | fc65cab | 2018-08-28 22:58:02 +0200 | [diff] [blame] | 191 | \ path_info |
Bram Moolenaar | 0065402 | 2011-02-25 14:42:19 +0100 | [diff] [blame] | 192 | \ preserve_groups |
Bram Moolenaar | fc65cab | 2018-08-28 22:58:02 +0200 | [diff] [blame] | 193 | \ pwfeedback |
Bram Moolenaar | 0065402 | 2011-02-25 14:42:19 +0100 | [diff] [blame] | 194 | \ requiretty |
| 195 | \ root_sudo |
| 196 | \ rootpw |
| 197 | \ runaspw |
| 198 | \ set_home |
| 199 | \ set_logname |
Bram Moolenaar | fc65cab | 2018-08-28 22:58:02 +0200 | [diff] [blame] | 200 | \ set_utmp |
Bram Moolenaar | 0065402 | 2011-02-25 14:42:19 +0100 | [diff] [blame] | 201 | \ setenv |
| 202 | \ shell_noargs |
| 203 | \ stay_setuid |
Bram Moolenaar | fc65cab | 2018-08-28 22:58:02 +0200 | [diff] [blame] | 204 | \ sudoedit_checkdir |
Bram Moolenaar | dad4473 | 2021-03-31 20:07:33 +0200 | [diff] [blame] | 205 | \ sudoedit_follow |
Bram Moolenaar | fc65cab | 2018-08-28 22:58:02 +0200 | [diff] [blame] | 206 | \ syslog_pid |
Bram Moolenaar | 0065402 | 2011-02-25 14:42:19 +0100 | [diff] [blame] | 207 | \ targetpw |
| 208 | \ tty_tickets |
Bram Moolenaar | fc65cab | 2018-08-28 22:58:02 +0200 | [diff] [blame] | 209 | \ umask_override |
| 210 | \ use_netgroups |
| 211 | \ use_pty |
| 212 | \ user_command_timeouts |
| 213 | \ utmp_runas |
Bram Moolenaar | 0065402 | 2011-02-25 14:42:19 +0100 | [diff] [blame] | 214 | \ visiblepw |
| 215 | |
| 216 | syn keyword sudoersIntegerParameter contained |
| 217 | \ nextgroup=sudoersIntegerParameterEquals |
| 218 | \ skipwhite skipnl |
| 219 | \ closefrom |
Bram Moolenaar | fc65cab | 2018-08-28 22:58:02 +0200 | [diff] [blame] | 220 | \ command_timeout |
Bram Moolenaar | 0065402 | 2011-02-25 14:42:19 +0100 | [diff] [blame] | 221 | \ loglinelen |
Bram Moolenaar | fc65cab | 2018-08-28 22:58:02 +0200 | [diff] [blame] | 222 | \ maxseq |
Bram Moolenaar | 0065402 | 2011-02-25 14:42:19 +0100 | [diff] [blame] | 223 | \ passwd_timeout |
Bram Moolenaar | fc65cab | 2018-08-28 22:58:02 +0200 | [diff] [blame] | 224 | \ passwd_tries |
| 225 | \ syslog_maxlen |
Bram Moolenaar | 0065402 | 2011-02-25 14:42:19 +0100 | [diff] [blame] | 226 | \ timestamp_timeout |
| 227 | \ umask |
| 228 | |
| 229 | syn keyword sudoersStringParameter contained |
| 230 | \ nextgroup=sudoersStringParameterEquals |
| 231 | \ skipwhite skipnl |
Bram Moolenaar | fc65cab | 2018-08-28 22:58:02 +0200 | [diff] [blame] | 232 | \ askpass |
Bram Moolenaar | 0065402 | 2011-02-25 14:42:19 +0100 | [diff] [blame] | 233 | \ badpass_message |
| 234 | \ editor |
Bram Moolenaar | 0065402 | 2011-02-25 14:42:19 +0100 | [diff] [blame] | 235 | \ env_file |
| 236 | \ exempt_group |
Bram Moolenaar | fc65cab | 2018-08-28 22:58:02 +0200 | [diff] [blame] | 237 | \ fdexec |
| 238 | \ group_plugin |
| 239 | \ iolog_dir |
| 240 | \ iolog_file |
| 241 | \ iolog_flush |
| 242 | \ iolog_group |
| 243 | \ iolog_mode |
| 244 | \ iolog_user |
Bram Moolenaar | 0065402 | 2011-02-25 14:42:19 +0100 | [diff] [blame] | 245 | \ lecture |
| 246 | \ lecture_file |
Bram Moolenaar | fc65cab | 2018-08-28 22:58:02 +0200 | [diff] [blame] | 247 | \ lecture_status_dir |
Bram Moolenaar | 0065402 | 2011-02-25 14:42:19 +0100 | [diff] [blame] | 248 | \ listpw |
| 249 | \ logfile |
| 250 | \ mailerflags |
| 251 | \ mailerpath |
| 252 | \ mailfrom |
Bram Moolenaar | fc65cab | 2018-08-28 22:58:02 +0200 | [diff] [blame] | 253 | \ mailsub |
Bram Moolenaar | 0065402 | 2011-02-25 14:42:19 +0100 | [diff] [blame] | 254 | \ mailto |
Bram Moolenaar | fc65cab | 2018-08-28 22:58:02 +0200 | [diff] [blame] | 255 | \ noexec_file |
| 256 | \ pam_login_service |
| 257 | \ pam_service |
| 258 | \ passprompt |
| 259 | \ restricted_env_file |
| 260 | \ role |
| 261 | \ runas_default |
Bram Moolenaar | 0065402 | 2011-02-25 14:42:19 +0100 | [diff] [blame] | 262 | \ secure_path |
Bram Moolenaar | fc65cab | 2018-08-28 22:58:02 +0200 | [diff] [blame] | 263 | \ sudoers_locale |
Bram Moolenaar | 0065402 | 2011-02-25 14:42:19 +0100 | [diff] [blame] | 264 | \ syslog |
Bram Moolenaar | fc65cab | 2018-08-28 22:58:02 +0200 | [diff] [blame] | 265 | \ syslog_badpri |
| 266 | \ syslog_goodpri |
| 267 | \ timestamp_type |
| 268 | \ timestampdir |
| 269 | \ timestampowner |
| 270 | \ type |
Bram Moolenaar | 0065402 | 2011-02-25 14:42:19 +0100 | [diff] [blame] | 271 | \ verifypw |
| 272 | |
| 273 | syn keyword sudoersListParameter contained |
| 274 | \ nextgroup=sudoersListParameterEquals |
| 275 | \ skipwhite skipnl |
| 276 | \ env_check |
| 277 | \ env_delete |
| 278 | \ env_keep |
Bram Moolenaar | 1cd871b | 2004-12-19 22:46:22 +0000 | [diff] [blame] | 279 | |
| 280 | syn match sudoersParameterListComma contained ',' nextgroup=@sudoersParameter skipwhite skipnl |
| 281 | |
Bram Moolenaar | 446cb83 | 2008-06-24 21:56:24 +0000 | [diff] [blame] | 282 | syn cluster sudoersParameter contains=sudoersBooleanParameter,sudoersIntegerParameter,sudoersStringParameter,sudoersListParameter |
Bram Moolenaar | 1cd871b | 2004-12-19 22:46:22 +0000 | [diff] [blame] | 283 | |
| 284 | syn match sudoersIntegerParameterEquals contained '[+-]\==' nextgroup=sudoersIntegerValue skipwhite skipnl |
| 285 | syn match sudoersStringParameterEquals contained '[+-]\==' nextgroup=sudoersStringValue skipwhite skipnl |
Bram Moolenaar | 42eeac3 | 2005-06-29 22:40:58 +0000 | [diff] [blame] | 286 | syn match sudoersListParameterEquals contained '[+-]\==' nextgroup=sudoersListValue skipwhite skipnl |
Bram Moolenaar | 1cd871b | 2004-12-19 22:46:22 +0000 | [diff] [blame] | 287 | |
Bram Moolenaar | 42eeac3 | 2005-06-29 22:40:58 +0000 | [diff] [blame] | 288 | syn match sudoersIntegerValue contained '\d\+' nextgroup=sudoersParameterListComma skipwhite skipnl |
| 289 | syn match sudoersStringValue contained '[^[:space:],:=\\]*\%(\\[[:space:],:=\\][^[:space:],:=\\]*\)*' nextgroup=sudoersParameterListComma skipwhite skipnl |
| 290 | syn region sudoersStringValue contained start=+"+ skip=+\\"+ end=+"+ nextgroup=sudoersParameterListComma skipwhite skipnl |
| 291 | syn match sudoersListValue contained '[^[:space:],:=\\]*\%(\\[[:space:],:=\\][^[:space:],:=\\]*\)*' nextgroup=sudoersParameterListComma skipwhite skipnl |
| 292 | syn region sudoersListValue contained start=+"+ skip=+\\"+ end=+"+ nextgroup=sudoersParameterListComma skipwhite skipnl |
Bram Moolenaar | 1cd871b | 2004-12-19 22:46:22 +0000 | [diff] [blame] | 293 | |
Bram Moolenaar | 42eeac3 | 2005-06-29 22:40:58 +0000 | [diff] [blame] | 294 | syn match sudoersPASSWD contained '\%(NO\)\=PASSWD:' nextgroup=@sudoersCmndInSpec skipwhite |
Bram Moolenaar | 1cd871b | 2004-12-19 22:46:22 +0000 | [diff] [blame] | 295 | |
Bram Moolenaar | 42eeac3 | 2005-06-29 22:40:58 +0000 | [diff] [blame] | 296 | hi def link sudoersSpecEquals Operator |
| 297 | hi def link sudoersTodo Todo |
| 298 | hi def link sudoersComment Comment |
| 299 | hi def link sudoersAlias Keyword |
| 300 | hi def link sudoersUserAlias Identifier |
| 301 | hi def link sudoersUserNameInList String |
| 302 | hi def link sudoersUIDInList Number |
| 303 | hi def link sudoersGroupInList PreProc |
| 304 | hi def link sudoersUserNetgroupInList PreProc |
| 305 | hi def link sudoersUserAliasInList PreProc |
| 306 | hi def link sudoersUserName String |
| 307 | hi def link sudoersUID Number |
| 308 | hi def link sudoersGroup PreProc |
| 309 | hi def link sudoersUserNetgroup PreProc |
| 310 | hi def link sudoersUserAliasRef PreProc |
| 311 | hi def link sudoersUserNameInSpec String |
| 312 | hi def link sudoersUIDInSpec Number |
| 313 | hi def link sudoersGroupInSpec PreProc |
| 314 | hi def link sudoersUserNetgroupInSpec PreProc |
| 315 | hi def link sudoersUserAliasInSpec PreProc |
| 316 | hi def link sudoersUserNameInRunas String |
| 317 | hi def link sudoersUIDInRunas Number |
| 318 | hi def link sudoersGroupInRunas PreProc |
| 319 | hi def link sudoersUserNetgroupInRunas PreProc |
| 320 | hi def link sudoersUserAliasInRunas PreProc |
| 321 | hi def link sudoersHostAlias Identifier |
| 322 | hi def link sudoersHostNameInList String |
| 323 | hi def link sudoersIPAddrInList Number |
| 324 | hi def link sudoersNetworkInList Number |
| 325 | hi def link sudoersHostNetgroupInList PreProc |
| 326 | hi def link sudoersHostAliasInList PreProc |
| 327 | hi def link sudoersHostName String |
| 328 | hi def link sudoersIPAddr Number |
| 329 | hi def link sudoersNetwork Number |
| 330 | hi def link sudoersHostNetgroup PreProc |
| 331 | hi def link sudoersHostAliasRef PreProc |
| 332 | hi def link sudoersHostNameInSpec String |
| 333 | hi def link sudoersIPAddrInSpec Number |
| 334 | hi def link sudoersNetworkInSpec Number |
| 335 | hi def link sudoersHostNetgroupInSpec PreProc |
| 336 | hi def link sudoersHostAliasInSpec PreProc |
| 337 | hi def link sudoersCmndAlias Identifier |
| 338 | hi def link sudoersCmndNameInList String |
| 339 | hi def link sudoersCmndAliasInList PreProc |
| 340 | hi def link sudoersCmndNameInSpec String |
| 341 | hi def link sudoersCmndAliasInSpec PreProc |
| 342 | hi def link sudoersUserAliasEquals Operator |
| 343 | hi def link sudoersUserListComma Delimiter |
| 344 | hi def link sudoersUserListColon Delimiter |
| 345 | hi def link sudoersUserSpecComma Delimiter |
| 346 | hi def link sudoersUserRunasBegin Delimiter |
| 347 | hi def link sudoersUserRunasComma Delimiter |
| 348 | hi def link sudoersUserRunasEnd Delimiter |
| 349 | hi def link sudoersHostAliasEquals Operator |
| 350 | hi def link sudoersHostListComma Delimiter |
| 351 | hi def link sudoersHostListColon Delimiter |
| 352 | hi def link sudoersHostSpecComma Delimiter |
| 353 | hi def link sudoersCmndAliasEquals Operator |
| 354 | hi def link sudoersCmndListComma Delimiter |
| 355 | hi def link sudoersCmndListColon Delimiter |
| 356 | hi def link sudoersCmndSpecComma Delimiter |
| 357 | hi def link sudoersCmndSpecColon Delimiter |
| 358 | hi def link sudoersUserNegationInList Operator |
| 359 | hi def link sudoersHostNegationInList Operator |
| 360 | hi def link sudoersCmndNegationInList Operator |
| 361 | hi def link sudoersUserNegation Operator |
| 362 | hi def link sudoersHostNegation Operator |
| 363 | hi def link sudoersUserNegationInSpec Operator |
| 364 | hi def link sudoersHostNegationInSpec Operator |
| 365 | hi def link sudoersUserNegationInRunas Operator |
| 366 | hi def link sudoersCmndNegationInSpec Operator |
| 367 | hi def link sudoersCommandArgs String |
| 368 | hi def link sudoersCommandEmpty Special |
| 369 | hi def link sudoersDefaultEntry Keyword |
| 370 | hi def link sudoersDefaultTypeAt Special |
| 371 | hi def link sudoersDefaultTypeColon Special |
| 372 | hi def link sudoersDefaultTypeGreaterThan Special |
| 373 | hi def link sudoersBooleanParameter Identifier |
| 374 | hi def link sudoersIntegerParameter Identifier |
| 375 | hi def link sudoersStringParameter Identifier |
| 376 | hi def link sudoersListParameter Identifier |
| 377 | hi def link sudoersParameterListComma Delimiter |
| 378 | hi def link sudoersIntegerParameterEquals Operator |
| 379 | hi def link sudoersStringParameterEquals Operator |
| 380 | hi def link sudoersListParameterEquals Operator |
| 381 | hi def link sudoersIntegerValue Number |
| 382 | hi def link sudoersStringValue String |
| 383 | hi def link sudoersListValue String |
| 384 | hi def link sudoersPASSWD Special |
Bram Moolenaar | a9604e6 | 2018-07-21 05:56:22 +0200 | [diff] [blame] | 385 | hi def link sudoersInclude Statement |
Bram Moolenaar | 1cd871b | 2004-12-19 22:46:22 +0000 | [diff] [blame] | 386 | |
| 387 | let b:current_syntax = "sudoers" |
| 388 | |
Bram Moolenaar | 42eeac3 | 2005-06-29 22:40:58 +0000 | [diff] [blame] | 389 | let &cpo = s:cpo_save |
| 390 | unlet s:cpo_save |