feat: add grapple toggle keybind

This commit is contained in:
2024-01-08 18:25:10 +01:00
parent 7a5340686a
commit 6f3e935980
+23 -3
View File
@@ -4,12 +4,32 @@ local function setup()
local grapple = require("grapple")
grapple.setup()
vim.keymap.set("n", "<leader>'", grapple.popup_tags)
vim.keymap.set("n", "<leader>mm", function ()
if grapple.exists() then
grapple.untag()
return
end
for i = 1, 9 do
vim.keymap.set("n", "<leader>m" .. i, function ()
grapple.tag({ key = "m" .. i, })
local opts = { key = "m" .. i, }
if not grapple.exists(opts) then
grapple.tag(opts)
return
end
end
grapple.tag({ key = "m?", })
end)
for i = 1, 9 do
local opts = { key = "m" .. i, }
vim.keymap.set("n", "<leader>m" .. i, function ()
grapple.tag(opts)
end)
vim.keymap.set("n", "<leader>" .. i, function ()
grapple.select({ key = "m" .. i, })
grapple.select(opts)
end)
end
end