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 11function ! suda#system (cmd, ... ) abort
22 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 )
55 if &verbose
66 echomsg ' [suda]' cmd
77 endif
@@ -15,7 +15,7 @@ function! suda#system(cmd, ...) abort
1515 finally
1616 call inputrestore ()
1717 endtry
18- let cmd = printf (' sudo -p '''' -S %s' , a: cmd )
18+ let cmd = printf (' %s -p '''' -S %s' , g: suda # executable , a: cmd )
1919 return system (cmd, password . " \n " . (a: 0 ? a: 1 : ' ' ))
2020endfunction
2121
@@ -265,3 +265,4 @@ augroup END
265265" Configure
266266let g: suda #nopass = get (g: , ' suda#nopass' , 0 )
267267let 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}])
160160-----------------------------------------------------------------------------
161161VARIABLE *suda-interface-variable*
162162
163+ *g:suda#executable*
164+ A executable of "sudo" command.
165+ Default: "sudo"
166+
163167*g:suda#nopass*
164168 If set, suda will not prompt you for a password before saving a file.
165169 It is suppossed to support a setup with passwordless sudo or doas.
You can’t perform that action at this time.
0 commit comments