lazy.nvim
lazy.nvim copied to clipboard
feature: `restore` plugins by default
Did you check the docs?
- [X] I have read all the lazy.nvim docs
Is your feature request related to a problem? Please describe.
As nearly all of us, I store my dotfiles in a git repo. lock-file.json is stored under version control too.
However, if I clone my setup to a new machine, open up neovim, Lazy begins to install the latest version of each plugin automatically and overwrites the lockfile.
To get the locked versions after that I need:
git restore path/to/lockfilenvim->:Lazy restore
which is quite inconvenient
Describe the solution you'd like
If lockfile exists then restore all the plugins, otherwise install the newest version. If a plugin is listed in the spec but is not in the lockfile, then install the latest version and update the lockfile
Describe alternatives you've considered
git restore path/to/lockfilenvim->:Lazy restore
Additional context
No response
#1804 (How to use the Lock file when lazy.nvim loads for the first time?)
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.
it has 3 likes and i think we need this
#1279 ?
If lockfile exists then restore all the plugins, otherwise install the newest version. If a plugin is listed in the spec but is not in the lockfile, then install the latest version and update the lockfile
That's already how it works. Install missing always uses the lock file.
If you however do Lazy install, then it will not use the lock file.
That's already how it works. Install missing always uses the lock file.
That's not true. For me on lazy.nvim commit d8f26efd456190241afd1b0f5235fe6fdba13d4a, it always updates other plugins after auto-intall and changes the whole lock file.
@Bekaboo there were already multiple issues opened about this you can surely find how things are supposed to work there
@Bekaboo there were already multiple issues opened about this you can surely find how things are supposed to work there
Yes but many of them are closed as not planned including #1279 and I found no way to prevent lazy.nvim from changing the lock file after auto-install.
they are closed as not planned because things are working as intended
I observed that the update of the lock file is due to the changes of lazy.nvim itself, nor the other plugins.
diff --git a/.config/nvim/lazy-lock.json b/.config/nvim/lazy-lock.json index 1fc8cc7..00353b1 100644 --- a/.config/nvim/lazy-lock.json +++ b/.config/nvim/lazy-lock.json @@ -8,7 +8,7 @@ "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, "cmp-snippy": { "branch": "master", "commit": "6e39210aa3a74e2bf6462f492eaf0d436cd2b7d3" }, "copilot.lua": { "branch": "master", "commit": "f8d8d872bb319f640d5177dad5fbf01f7a16d7d0" }, - "lazy.nvim": { "branch": "main", "commit": "7967abe55752aa90532e6bb4bd4663fe27a264cb" }, + "lazy.nvim": { "branch": "main", "commit": "7e6c863bc7563efbdd757a310d17ebc95166cef3" }, "lualine.nvim": { "branch": "master", "commit": "2a5bae925481f999263d6f5ed8361baef8df4f83" }, "mason-lspconfig.nvim": { "branch": "main", "commit": "4d0e5b49363cac187326998b96aa6a2884e0e89b" }, "mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" },It would be appreciated if the lazy.nvim itself could be restored as well.
From https://github.com/folke/lazy.nvim/issues/1279#issuecomment-2635769792