mirror of
https://github.com/folke/lazy.nvim.git
synced 2025-06-28 11:24:14 +00:00
feat: configurable default pinning of plugins
This commit is contained in:
parent
89ddc59d19
commit
ddcafa726f
4 changed files with 6 additions and 0 deletions
|
@ -300,6 +300,7 @@ return {
|
||||||
defaults = {
|
defaults = {
|
||||||
lazy = false, -- should plugins be lazy-loaded?
|
lazy = false, -- should plugins be lazy-loaded?
|
||||||
version = nil,
|
version = nil,
|
||||||
|
pin = false,
|
||||||
-- default `cond` you can use to globally disable a lot of plugins
|
-- default `cond` you can use to globally disable a lot of plugins
|
||||||
-- when running inside vscode for example
|
-- when running inside vscode for example
|
||||||
cond = nil, ---@type boolean|fun(self:LazyPlugin):boolean|nil
|
cond = nil, ---@type boolean|fun(self:LazyPlugin):boolean|nil
|
||||||
|
|
|
@ -404,6 +404,7 @@ CONFIGURATION *lazy.nvim-lazy.nvim-configuration*
|
||||||
defaults = {
|
defaults = {
|
||||||
lazy = false, -- should plugins be lazy-loaded?
|
lazy = false, -- should plugins be lazy-loaded?
|
||||||
version = nil,
|
version = nil,
|
||||||
|
pin = false,
|
||||||
-- default `cond` you can use to globally disable a lot of plugins
|
-- default `cond` you can use to globally disable a lot of plugins
|
||||||
-- when running inside vscode for example
|
-- when running inside vscode for example
|
||||||
cond = nil, ---@type boolean|fun(self:LazyPlugin):boolean|nil
|
cond = nil, ---@type boolean|fun(self:LazyPlugin):boolean|nil
|
||||||
|
|
|
@ -9,6 +9,7 @@ M.defaults = {
|
||||||
defaults = {
|
defaults = {
|
||||||
lazy = false, -- should plugins be lazy-loaded?
|
lazy = false, -- should plugins be lazy-loaded?
|
||||||
version = nil,
|
version = nil,
|
||||||
|
pin = false,
|
||||||
-- default `cond` you can use to globally disable a lot of plugins
|
-- default `cond` you can use to globally disable a lot of plugins
|
||||||
-- when running inside vscode for example
|
-- when running inside vscode for example
|
||||||
cond = nil, ---@type boolean|fun(self:LazyPlugin):boolean|nil
|
cond = nil, ---@type boolean|fun(self:LazyPlugin):boolean|nil
|
||||||
|
|
|
@ -515,6 +515,9 @@ function M.update_state()
|
||||||
or plugin.cmd
|
or plugin.cmd
|
||||||
plugin.lazy = lazy and true or false
|
plugin.lazy = lazy and true or false
|
||||||
end
|
end
|
||||||
|
if plugin.pin == nil then
|
||||||
|
plugin.pin = Config.options.defaults.pin
|
||||||
|
end
|
||||||
if plugin.dir:find(Config.options.root, 1, true) == 1 then
|
if plugin.dir:find(Config.options.root, 1, true) == 1 then
|
||||||
plugin._.installed = installed[plugin.name] ~= nil
|
plugin._.installed = installed[plugin.name] ~= nil
|
||||||
installed[plugin.name] = nil
|
installed[plugin.name] = nil
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue