feat(extras): big rework of default extras

This commit is contained in:
Folke Lemaitre 2025-02-08 15:04:46 +01:00
parent 0416376733
commit 525377dee9
No known key found for this signature in database
GPG key ID: 41F8B1FBACAE2040
13 changed files with 222 additions and 200 deletions

View file

@ -7,6 +7,7 @@ local prios = {
["lazyvim.plugins.extras.lang.typescript"] = 5,
["lazyvim.plugins.extras.coding.blink"] = 5,
["lazyvim.plugins.extras.formatting.prettier"] = 10,
-- default core extra priority is 20
-- default priority is 50
["lazyvim.plugins.extras.editor.aerial"] = 100,
["lazyvim.plugins.extras.editor.outline"] = 100,
@ -16,8 +17,27 @@ if vim.g.xtras_prios then
prios = vim.tbl_deep_extend("force", prios, vim.g.xtras_prios or {})
end
local extras = {} ---@type string[]
local defaults = LazyVim.config.get_defaults()
-- Add extras from LazyExtras that are not disabled
for _, extra in ipairs(LazyVim.config.json.data.extras) do
local def = defaults[extra]
if not (def and def.enabled == false) then
extras[#extras + 1] = extra
end
end
-- Add default extras
for name, extra in pairs(defaults) do
if extra.enabled then
prios[name] = prios[name] or 20
extras[#extras + 1] = name
end
end
---@type string[]
local extras = LazyVim.dedup(LazyVim.config.json.data.extras)
extras = LazyVim.dedup(extras)
local version = vim.version()
local v = version.major .. "_" .. version.minor