File tree Expand file tree Collapse file tree 3 files changed +12
-1
lines changed
Expand file tree Collapse file tree 3 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -69,3 +69,7 @@ Make sure that the following shows `1`.
6969``` vim
7070: echo executable('sudo')
7171```
72+
73+ ### Use sudo without a password
74+
75+ When ` let g:suda#nopass = 1 ` is written in your vimrc, suda won't ask you for a password. Use at your own risk.
Original file line number Diff line number Diff line change 11function ! suda#system (cmd, ... ) abort
2- let cmd = has (' win32' )
2+ let cmd = has (' win32' ) || g: suda #nopass
33 \ ? printf (' sudo %s' , a: cmd )
44 \ : printf (' sudo -p '''' -n %s' , a: cmd )
55 if &verbose
@@ -263,4 +263,5 @@ augroup suda_internal
263263augroup END
264264
265265" Configure
266+ let g: suda #nopass = get (g: , ' suda#nopass' , 0 )
266267let g: suda #prompt = get (g: , ' suda#prompt' , ' Password: ' )
Original file line number Diff line number Diff line change @@ -160,6 +160,12 @@ suda#write({expr} [, {options}])
160160-----------------------------------------------------------------------------
161161VARIABLE *suda-interface-variable*
162162
163+ *g:suda#nopass*
164+ If set, suda will not prompt you for a password before saving a file.
165+ It is suppossed to support a setup with passwordless sudo or doas.
166+ Use with care.
167+ Default: 0
168+
163169*g:suda#prompt*
164170 A prompt string used to ask password.
165171 Default: "Password: "
You can’t perform that action at this time.
0 commit comments