File tree Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change 1
1
function ! suda#system (cmd, ... ) abort
2
2
let cmd = has (' win32' ) || g: suda #nopass
3
- \ ? printf (' sudo %s' , a: cmd )
4
- \ : printf (' sudo -p '''' -n %s' , a: cmd )
3
+ \ ? printf (' %s %s' , g: suda # executable , a: cmd )
4
+ \ : printf (' %s -p '''' -n %s' , g: suda # executable , a: cmd )
5
5
if &verbose
6
6
echomsg ' [suda]' cmd
7
7
endif
@@ -15,7 +15,7 @@ function! suda#system(cmd, ...) abort
15
15
finally
16
16
call inputrestore ()
17
17
endtry
18
- let cmd = printf (' sudo -p '''' -S %s' , a: cmd )
18
+ let cmd = printf (' %s -p '''' -S %s' , g: suda # executable , a: cmd )
19
19
return system (cmd, password . " \n " . (a: 0 ? a: 1 : ' ' ))
20
20
endfunction
21
21
@@ -265,3 +265,4 @@ augroup END
265
265
" Configure
266
266
let g: suda #nopass = get (g: , ' suda#nopass' , 0 )
267
267
let g: suda #prompt = get (g: , ' suda#prompt' , ' Password: ' )
268
+ let g: suda #executable = get (g: , ' suda#executable' , ' sudo' )
Original file line number Diff line number Diff line change @@ -160,6 +160,10 @@ suda#write({expr} [, {options}])
160
160
-----------------------------------------------------------------------------
161
161
VARIABLE *suda-interface-variable*
162
162
163
+ *g:suda#executable*
164
+ A executable of "sudo" command.
165
+ Default: "sudo"
166
+
163
167
*g:suda#nopass*
164
168
If set, suda will not prompt you for a password before saving a file.
165
169
It is suppossed to support a setup with passwordless sudo or doas.
You can’t perform that action at this time.
0 commit comments