build: create separate keyamp groups per plugin

This commit is contained in:
Folke Lemaitre 2023-01-20 20:36:38 +01:00
parent 7be8efaa84
commit 3a1ef4150d
No known key found for this signature in database
GPG key ID: 41F8B1FBACAE2040

View file

@ -47,10 +47,10 @@ function M.keymaps()
local core = require("lazy.core.plugin").Spec.new({ import = "lazyvim.plugins" })
Util.foreach(core.plugins, function(name, plugin)
group = ("[%s](%s)"):format(plugin.name, plugin.url)
for _, key in ipairs(plugin.keys or {}) do
if type(key) == "table" and key.desc then
local desc = key.desc or ""
desc = ("[%s](%s)"):format(plugin.name, plugin.url) .. " " .. desc
map(key.mode or "n", key[1], key[2], { desc = desc })
end
end