Skip to content

Commit

Permalink
perf: Combine g?v, g?V keys
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Ferrier committed Mar 24, 2023
1 parent ee5a3a8 commit d18401e
Showing 1 changed file with 2 additions and 14 deletions.
16 changes: 2 additions & 14 deletions lua/debugprint/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -319,30 +319,18 @@ M.setup = function(opts)
expr = true,
desc = "Plain debug above current line",
})
vim.keymap.set("n", "g?v", function()
vim.keymap.set({ "n", "x" }, "g?v", function()
return M.debugprint({ variable = true })
end, {
expr = true,
desc = "Variable debug below current line",
})
vim.keymap.set("n", "g?V", function()
vim.keymap.set({ "n", "x" }, "g?V", function()
return M.debugprint({ above = true, variable = true })
end, {
expr = true,
desc = "Variable debug above current line",
})
vim.keymap.set("x", "g?v", function()
return M.debugprint({ variable = true })
end, {
expr = true,
desc = "Visually-selected variable debug below current line",
})
vim.keymap.set("x", "g?V", function()
return M.debugprint({ above = true, variable = true })
end, {
expr = true,
desc = "Visually-selected variable debug above current line",
})
vim.keymap.set("n", "g?o", function()
return M.debugprint({ motion = true })
end, {
Expand Down

0 comments on commit d18401e

Please sign in to comment.