Giter Site home page Giter Site logo

Comments (11)

aarondill avatar aarondill commented on August 15, 2024 1

@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 😃

from suda.vim.

aarondill avatar aarondill commented on August 15, 2024 1

@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 😃

from suda.vim.

lambdalisue avatar lambdalisue commented on August 15, 2024 1

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 (#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 😃

👍

from suda.vim.

aarondill avatar aarondill commented on August 15, 2024 1

@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

from suda.vim.

rew1nter avatar rew1nter commented on August 15, 2024

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?

from suda.vim.

lambdalisue avatar lambdalisue commented on August 15, 2024

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.

from suda.vim.

rew1nter avatar rew1nter commented on August 15, 2024

I think you don't need to load the variable. Just set the variable.

I tried what was told. And it was not set

from suda.vim.

lambdalisue avatar lambdalisue commented on August 15, 2024

How did you set and check?

from suda.vim.

rew1nter avatar rew1nter commented on August 15, 2024

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 :/

from suda.vim.

lambdalisue avatar lambdalisue commented on August 15, 2024

@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?

from suda.vim.

rew1nter avatar rew1nter commented on August 15, 2024

okay guys so just to be clear, There is currently no way of saving without root password?

from suda.vim.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.