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, }