feat: configurable default pinning of plugins

This commit is contained in:
Xarvex 2024-06-06 21:12:54 -05:00
commit ddcafa726f
No known key found for this signature in database
GPG key ID: A743BDBA677BE86D
4 changed files with 6 additions and 0 deletions

View file

@ -300,6 +300,7 @@ return {
defaults = {
lazy = false, -- should plugins be lazy-loaded?
version = nil,
pin = false,
-- default `cond` you can use to globally disable a lot of plugins
-- when running inside vscode for example
cond = nil, ---@type boolean|fun(self:LazyPlugin):boolean|nil

View file

@ -404,6 +404,7 @@ CONFIGURATION *lazy.nvim-lazy.nvim-configuration*
defaults = {
lazy = false, -- should plugins be lazy-loaded?
version = nil,
pin = false,
-- default `cond` you can use to globally disable a lot of plugins
-- when running inside vscode for example
cond = nil, ---@type boolean|fun(self:LazyPlugin):boolean|nil

View file

@ -9,6 +9,7 @@ M.defaults = {
defaults = {
lazy = false, -- should plugins be lazy-loaded?
version = nil,
pin = false,
-- default `cond` you can use to globally disable a lot of plugins
-- when running inside vscode for example
cond = nil, ---@type boolean|fun(self:LazyPlugin):boolean|nil

View file

@ -515,6 +515,9 @@ function M.update_state()
or plugin.cmd
plugin.lazy = lazy and true or false
end
if plugin.pin == nil then
plugin.pin = Config.options.defaults.pin
end
if plugin.dir:find(Config.options.root, 1, true) == 1 then
plugin._.installed = installed[plugin.name] ~= nil
installed[plugin.name] = nil