Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature: keep disable packages in the json #1606

Closed
1 task done
ilan-schemoul opened this issue Jul 3, 2024 · 3 comments · Fixed by #1612
Closed
1 task done

feature: keep disable packages in the json #1606

ilan-schemoul opened this issue Jul 3, 2024 · 3 comments · Fixed by #1612
Labels
enhancement New feature or request

Comments

@ilan-schemoul
Copy link

Did you check the docs?

  • I have read all the lazy.nvim docs

Is your feature request related to a problem? Please describe.

When a package has "enabled = false" then the package is removed from package.json (I believe).

Because the version is removed then if I enable a package again it's a different version from last time.

It's especially annoying that I have a work PC and a home PC with different packages enabled (controlled via env variable). My packages are therefore not properly locked to their versions on both of my PC and I have a ton of noise because git status shows me that package.json is different everytime I start nvim on my home/work PC.

A workaround I use is to use two differents package.json and loads them conditionnaly depending if it's work/home PC. But now every single package potentially has different versions so it's worse in that regard (but less noise in git status)

Describe the solution you'd like

Do not remove disabled packages from package.json

Describe alternatives you've considered

Make my solution optional (enable it via a flag). But I think it's better if always enabled

Another solution would be using the same package.json for my two environnements (for the packages enabled in both environnements) and have then two other package.json, one for each environnement, for only the packages that are enabled conditionnally. But it's kinda complicated I think because then how to specify what package.json to use etc.

Additional context

No response

@ilan-schemoul ilan-schemoul added the enhancement New feature or request label Jul 3, 2024
@jZhangTk
Copy link

jZhangTk commented Jul 5, 2024

I need this too. I just migrated to lazy, and it works very nicely except for this only one thing.

In some cases, I want to enable/disable plugins for certain conditions. E.g. I use obsidian for note taking, but I only want to enable it when I'm in the obsidian directory not just any markdown files.

I tried both enabled and cond, but they behave similarly. If either enabled or cond is false, the plugin will be removed from the lock file.

@folke
Copy link
Owner

folke commented Jul 5, 2024

See #1606

@folke folke closed this as completed in baac551 Jul 5, 2024
@folke
Copy link
Owner

folke commented Jul 5, 2024

Plugins with cond=false or disabled=true now remain in the lockfile

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants