diff --git a/lua/astrocommunity/motion/harpoon/init.lua b/lua/astrocommunity/motion/harpoon/init.lua index 97dcd10b8..185f2579c 100644 --- a/lua/astrocommunity/motion/harpoon/init.lua +++ b/lua/astrocommunity/motion/harpoon/init.lua @@ -1,4 +1,5 @@ local prefix = "" +local harpoon = require("harpoon") local term_string = vim.fn.exists "$TMUX" == 1 and "tmux" or "term" local maps = { n = {} } local icon = vim.g.icons_enabled and "󱡀 " or "" @@ -7,33 +8,34 @@ require("astronvim.utils").set_mappings(maps) return { { "ThePrimeagen/harpoon", + branch = "harpoon2", dependencies = { "nvim-lua/plenary.nvim", "nvim-telescope/telescope.nvim", }, cmd = { "Harpoon" }, keys = { - { 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" }, + { prefix .. "a", function() harpoon:list():append() end, desc = "Add file" }, + { prefix .. "e", function() harpoon.ui:toggle_quick_menu(harpoon:list()) end, desc = "Toggle quick menu" }, { "", function() vim.ui.input({ prompt = "Harpoon mark index: " }, function(input) local num = tonumber(input) - if num then require("harpoon.ui").nav_file(num) end + if num then harpoon:list():select(num) end end) end, desc = "Goto index of mark", }, - { "", function() require("harpoon.ui").nav_prev() end, desc = "Goto previous mark" }, - { "", function() require("harpoon.ui").nav_next() end, desc = "Goto next mark" }, + { "", function() harpoon:list():prev() end, desc = "Goto previous mark" }, + { "", function() harpoon:list():next() end, desc = "Goto next mark" }, { prefix .. "m", "Telescope harpoon marks", desc = "Show marks in Telescope" }, { prefix .. "t", function() vim.ui.input({ prompt = term_string .. " window number: " }, function(input) local num = tonumber(input) - if num then require("harpoon." .. term_string).gotoTerminal(num) end + if num then harpoon.term.gotoTerminal(num) end end) end, desc = "Go to " .. term_string .. " window",