feat(lazy): allow for hot loading plugin specs

This commit is contained in:
2024-04-21 03:20:28 +02:00
parent 2e36ef05d9
commit ac1e40bfee
31 changed files with 683 additions and 831 deletions
+35 -32
View File
@@ -1,37 +1,40 @@
-- https://github.com/cbochs/grapple.nvim
local function setup()
local grapple = require("grapple")
grapple.setup()
vim.keymap.set("n", "<leader>'", grapple.toggle_tags)
vim.keymap.set("n", "<leader>mm", function ()
if grapple.exists() then
grapple.untag()
return
end
for i = 1, 9 do
local opts = { name = "m" .. i, }
if not grapple.exists(opts) then
grapple.tag(opts)
---@type LazyPluginSpec
return {
"cbochs/grapple.nvim",
dependencies = { "nvim-lua/plenary.nvim" },
config = function()
local grapple = require("grapple")
grapple.setup()
vim.keymap.set("n", "<leader>'", grapple.toggle_tags)
vim.keymap.set("n", "<leader>mm", function()
if grapple.exists() then
grapple.untag()
return
end
for i = 1, 9 do
local opts = { name = "m" .. i }
if not grapple.exists(opts) then
grapple.tag(opts)
return
end
end
grapple.tag({ name = "m0" })
end)
for i = 1, 9 do
local opts = { name = "m" .. i }
vim.keymap.set("n", "<leader>m" .. i, function()
grapple.tag(opts)
end)
vim.keymap.set("n", "<leader>" .. i, function()
grapple.select(opts)
end)
end
grapple.tag({ name = "m?", })
end)
for i = 1, 9 do
local opts = { name = "m" .. i, }
vim.keymap.set("n", "<leader>m" .. i, function ()
grapple.tag(opts)
end)
vim.keymap.set("n", "<leader>" .. i, function ()
grapple.select(opts)
end)
end
end
return setup
end,
}