Skip to content

Commit

Permalink
docs: add extras keymaps to keymaps
Browse files Browse the repository at this point in the history
  • Loading branch information
folke committed Apr 16, 2023
1 parent f562d1d commit 54846ff
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions lua/lazyvim/util/build.lua
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,23 @@ function M.keymaps()
end
end)

Util.walk(root .. "/lua/lazyvim/plugins/extras", function(path, name, t)
if t == "file" and name:find("%.lua$") then
local modname = path:gsub(".*/lua/", ""):gsub("/", "."):gsub("%.lua$", "")
local extra_doc = "/plugins/extras/" .. modname:gsub("lazyvim%.plugins%.extras%.", "")
local extra = require("lazy.core.plugin").Spec.new({ import = modname })
Util.foreach(extra.plugins, function(name, plugin)
group = ("[%s](%s)\nPart of [%s](%s)"):format(plugin.name, plugin.url, modname, extra_doc)
for _, key in ipairs(plugin.keys or {}) do
if type(key) == "table" and key.desc then
local desc = key.desc or ""
map(key.mode or "n", key[1], key[2], { desc = desc })
end
end
end)
end
end)

---@type string[]
local lines = {}

Expand Down

0 comments on commit 54846ff

Please sign in to comment.