vim-suda
vim-suda copied to clipboard
How can I set this variable in nvim lua?
This may not be the place to ask but here I am. Im trying to set this in my init.lua file let g:suda#nopass = 1
Setting this in the init.lua file doens't work. I'm using nvchad and this is how I'm installing this plugin:
{
"lambdalisue/suda.vim",
lazy = false,
},
do you know how I can load this variable before the plugin is loaded?
do you know how I can load this variable before the plugin is loaded?
I think you don't need to load the variable. Just set the variable.
I think you don't need to load the variable. Just set the variable.
I tried what was told. And it was not set
How did you set and check?
Currently I have this in my init.lua file of nvchad:
vim.g["suda#prompt"] = "Mot de passe: "
vim.g["suda#nopass"] = 1
Here the prompt changes but still asks for the password :/
@lambdalisue this seems to be a documentation issue.
according to the docs, if you set suda#nopass
, then suda won't ask for a password, but really, suda attempts to run without a password, then asks for a password. this should be properly reflected in the docs.
alternatively, if this is a bug, then when suda#nopass
is set and the first attempt fails, we should stop trying.
I'm happy to submit a PR fixing this issue once I know what the intended behavior is 😃
@aarondill
You're right, the behavior is different from what one might expect from the variable name suda#nopass
. If there is a word that can better explain the current behavior, we could mark suda#nopass
as deprecated and change it to a new variable name. Do you have any good suggestions for a new variable name?
However, the intention of the issue creator is unclear (it's not clear whether the behavior of suda#nopass
is truly not intended, or if the timing of the configuration is off so it's not being configured properly). So if discussion is needed, please create a new issue. If you have a good name suggestion, feel free to submit a pull request directly.
Come to think of it, I really appreciate all the contributions you've been making recently. A bit off-topic, but would you be interested in joining as a collaborator?
@lambdalisue you know how the joke goes: There are only two hard things in Computer Science: cache invalidation and naming things.
That being said, perhaps suda#trynopass
or suda#nopassfirst
would be acceptable names?
I would love to join as a collaborator! This plugin is one of the core plugins that I use almost daily (I hate opening neovim as root and losing my config), so I'd love to help make it better :smiley:
you know how the joke goes: There are only two hard things in Computer Science: cache invalidation and naming things.
That is a universal truth of this world 📚
That being said, perhaps suda#trynopass or suda#nopassfirst would be acceptable names?
Well, I'm sorry but it's a bit... I feel there is a better name so I made a new issue (https://github.com/lambdalisue/suda.vim/issues/73).
I would love to join as a collaborator! This plugin is one of the core plugins that I use almost daily (I hate opening neovim as root and losing my config), so I'd love to help make it better 😃
👍
okay guys so just to be clear, There is currently no way of saving without root password?
@rew1nter if you set suda#nopass
, then suda will attempt to save without the root password. If you don't have sudo
set up to allow no password, then it will fail, then suda will ask for a password and try to save using it.
so if you want to save without a password, set suda#nopass
and setup sudo with NOPASSWD
How to set NOPASSWD: https://askubuntu.com/a/147265