vim-suda
vim-suda copied to clipboard
Prompt on new buffer with g:suda_smart_edit and g:suda#nopass
A prompt is displayed when creating a new buffer / non-existent file that requires sudo using the following config:
set runtimepath =$NVIM_PLUGINS/suda.vim
let g:suda_smart_edit = 1
let g:suda#nopass = 1
I think v:shell_error is set to "1" because the file doesn't exist.
Well, I'm sorry but I don't get your situation. Could you provide more details?
If I open a new buffer / window for a new file that requires root access, I am still prompted for a password even with let g:suda#nopass = 1 set.
I think the problem is in autoload/suda.vim function! suda#system(cmd, ...). v:shell_error is set to "1" because the file doesn't exist yet, so it doesn't return and proceeds to the prompt.
Make sense. I'm not sure if it can be solved easily but this should be an enhancement.
Thanks - if I get to it I will submit a pull request.
I believe this is the same issue as #61, which I describe here: https://github.com/lambdalisue/suda.vim/issues/61#issuecomment-1990924321