From d33e8b372905f92a9e4ab3aed7203d7a71e85702 Mon Sep 17 00:00:00 2001 From: tiago Date: Sat, 20 Apr 2024 15:55:00 +0100 Subject: [PATCH] updated to harpoon2 --- .config/nvim/lua/tsousa/plugins/harpoon.lua | 29 +++++++++++++-------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/.config/nvim/lua/tsousa/plugins/harpoon.lua b/.config/nvim/lua/tsousa/plugins/harpoon.lua index b22c104..4fd2479 100644 --- a/.config/nvim/lua/tsousa/plugins/harpoon.lua +++ b/.config/nvim/lua/tsousa/plugins/harpoon.lua @@ -1,15 +1,22 @@ return { - "theprimeagen/harpoon", - config = function() - local mark = require("harpoon.mark") - local ui = require("harpoon.ui") + "theprimeagen/harpoon", + branch = "harpoon2", + dependencies = "nvim-lua/plenary.nvim", + config = function() + local harpoon = require("harpoon") - vim.keymap.set("n", "a", mark.add_file) - vim.keymap.set("n", "", ui.toggle_quick_menu) + harpoon:setup() - vim.keymap.set("n", "", function() ui.nav_file(1) end) - vim.keymap.set("n", "", function() ui.nav_file(2) end) - vim.keymap.set("n", "", function() ui.nav_file(3) end) - vim.keymap.set("n", "", function() ui.nav_file(4) end) - end + vim.keymap.set("n", "a", function() harpoon:list():add() end) + vim.keymap.set("n", "", function() harpoon.ui:toggle_quick_menu(harpoon:list()) end) + + vim.keymap.set("n", "", function() harpoon:list():select(1) end) + vim.keymap.set("n", "", function() harpoon:list():select(2) end) + vim.keymap.set("n", "", function() harpoon:list():select(3) end) + vim.keymap.set("n", "", function() harpoon:list():select(4) end) + + -- Toggle previous & next buffers stored within Harpoon list + vim.keymap.set("n", "", function() harpoon:list():prev() end) + vim.keymap.set("n", "", function() harpoon:list():next() end) + end, }