Skip to content

Commit

Permalink
feat(harpoon): add keymap to jump mark index
Browse files Browse the repository at this point in the history
  • Loading branch information
RayJameson committed Jun 20, 2023
1 parent 97054c9 commit f21f4e2
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion lua/astrocommunity/motion/harpoon/harpoon.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@ else
dynamic_tmux_keymap_desc = "Goto to terminal window"
end
local icon
if vim.g.icons_enabled then icon = "󱡀 " else icon = "" end
if vim.g.icons_enabled then
icon = "󱡀 "
else
icon = ""
end
return {
"ThePrimeagen/harpoon",
dependencies = {
Expand All @@ -19,6 +23,15 @@ return {
{ prefix, function() end, desc = icon .. "Harpoon" },
{ prefix .. "a", function() require("harpoon.mark").add_file() end, desc = "Add file" },
{ prefix .. "e", function() require("harpoon.ui").toggle_quick_menu() end, desc = "Toggle quick menu" },
{
"<C-t>",
function()
local num = tonumber(vim.fn.input "Go to mark index: ")
if num == nil then return end
require("harpoon.ui").nav_file(num)
end,
desc = "Goto index of mark",
},
{ "<C-p>", function() require("harpoon.ui").nav_prev() end, desc = "Goto previous mark" },
{ "<C-n>", function() require("harpoon.ui").nav_next() end, desc = "Goto next mark" },
{ prefix .. "m", "<cmd>Telescope harpoon marks<CR>", desc = "Show marks in Telescope" },
Expand Down

0 comments on commit f21f4e2

Please sign in to comment.