From 62d2dcf51300b2b89d62ae9c2cf2a32df6203fe3 Mon Sep 17 00:00:00 2001 From: luxus Date: Sun, 11 Feb 2024 19:16:54 +0100 Subject: [PATCH 1/2] feat(harpoon): Update to v2 branch --- lua/astrocommunity/motion/harpoon/init.lua | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/lua/astrocommunity/motion/harpoon/init.lua b/lua/astrocommunity/motion/harpoon/init.lua index 97dcd10b8..b640d8d67 100644 --- a/lua/astrocommunity/motion/harpoon/init.lua +++ b/lua/astrocommunity/motion/harpoon/init.lua @@ -7,38 +7,44 @@ 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() require("harpoon"):list():append() end, desc = "Add file" }, + { + prefix .. "e", + function() require("harpoon").ui:toggle_quick_menu(require("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 require("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() require("harpoon"):list():prev() end, desc = "Goto previous mark" }, + { "", function() require("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 require("harpoon").term.gotoTerminal(num) end end) end, desc = "Go to " .. term_string .. " window", }, }, + opts = {}, }, { "catppuccin/nvim", From 6bd12c993efca87ca45f4f06ea4525bb7c5c6212 Mon Sep 17 00:00:00 2001 From: Uzair Aftab <48220549+Uzaaft@users.noreply.github.com> Date: Mon, 12 Feb 2024 16:19:15 +0100 Subject: [PATCH 2/2] fix(harpoon): Remove invalid cmd table --- lua/astrocommunity/motion/harpoon/init.lua | 1 - 1 file changed, 1 deletion(-) diff --git a/lua/astrocommunity/motion/harpoon/init.lua b/lua/astrocommunity/motion/harpoon/init.lua index b640d8d67..8400dbe25 100644 --- a/lua/astrocommunity/motion/harpoon/init.lua +++ b/lua/astrocommunity/motion/harpoon/init.lua @@ -12,7 +12,6 @@ return { "nvim-lua/plenary.nvim", "nvim-telescope/telescope.nvim", }, - cmd = { "Harpoon" }, keys = { { prefix .. "a", function() require("harpoon"):list():append() end, desc = "Add file" }, {