diff --git a/nvim/lazy-lock.json b/nvim/lazy-lock.json index 83fba51..5d0323f 100644 --- a/nvim/lazy-lock.json +++ b/nvim/lazy-lock.json @@ -40,7 +40,7 @@ "gen.nvim": { "branch": "main", "commit": "2cb643b1a827bcdfc665a37d5f8174249d2d5bf5" }, "gh.nvim": { "branch": "main", "commit": "3181973d0c80fe0553e30e0aeeb860bedef9a33b" }, "gitsigns.nvim": { "branch": "main", "commit": "4e348641b8206c3b8d23080999e3ddbe4ca90efc" }, - "harpoon": { "branch": "master", "commit": "ccae1b9bec717ae284906b0bf83d720e59d12b91" }, + "harpoon": { "branch": "harpoon2", "commit": "a38be6e0dd4c6db66997deab71fc4453ace97f9c" }, "highlight-undo.nvim": { "branch": "main", "commit": "50a6884a8476be04ecce8f1c4ed692c5000ef0a1" }, "inc-rename.nvim": { "branch": "main", "commit": "6f9b5f9cb237e12935144cdc535322b8c93c1b25" }, "indent-blankline.nvim": { "branch": "master", "commit": "3d08501caef2329aba5121b753e903904088f7e6" }, diff --git a/nvim/lua/config/lazy.lua b/nvim/lua/config/lazy.lua index 092da96..082c512 100644 --- a/nvim/lua/config/lazy.lua +++ b/nvim/lua/config/lazy.lua @@ -18,6 +18,7 @@ require("lazy").setup({ { import = "lazyvim.plugins.extras.coding.copilot" }, { import = "lazyvim.plugins.extras.dap.core" }, { import = "lazyvim.plugins.extras.editor.aerial" }, + { import = "lazyvim.plugins.extras.editor.harpoon2" }, { import = "lazyvim.plugins.extras.formatting.prettier" }, { import = "lazyvim.plugins.extras.lang.json" }, { import = "lazyvim.plugins.extras.lang.ruby" }, diff --git a/nvim/lua/plugins/harpoon.lua b/nvim/lua/plugins/harpoon.lua index 2d13e31..8a343f4 100644 --- a/nvim/lua/plugins/harpoon.lua +++ b/nvim/lua/plugins/harpoon.lua @@ -2,24 +2,62 @@ -- https://github.com/ThePrimeagen/harpoon return { "ThePrimeagen/harpoon", - dependencies = "nvim-telescope/telescope.nvim", - -- stylua: ignore + branch = "harpoon2", keys = { - { "a", function() require("harpoon.mark").add_file() end, desc = "Harpoon Add File" }, - { ";", function() require("harpoon.ui").toggle_quick_menu() end, desc = "Harpoon Toggle Quickmenu" }, - { "1", function() require("harpoon.ui").nav_file(1) end, desc = "Harpoon Buffer 1" }, - { "2", function() require("harpoon.ui").nav_file(2) end, desc = "Harpoon Buffer 2" }, - { "3", function() require("harpoon.ui").nav_file(3) end, desc = "Harpoon Buffer 3" }, - { "4", function() require("harpoon.ui").nav_file(4) end, desc = "Harpoon Buffer 4" }, + { + "a", + function() + require("harpoon"):list():append() + end, + desc = "Harpoon Add File", + }, + { + ";", + function() + local harpoon = require("harpoon") + harpoon.ui:toggle_quick_menu(harpoon:list()) + end, + desc = "Harpoon Quickmenu", + }, + { + "1", + function() + require("harpoon"):list():select(1) + end, + desc = "Harpoon Buffer 1", + }, + { + "2", + function() + require("harpoon"):list():select(2) + end, + desc = "Harpoon Buffer 2", + }, + { + "3", + function() + require("harpoon"):list():select(3) + end, + desc = "Harpoon Buffer 3", + }, + { + "4", + function() + require("harpoon"):list():select(4) + end, + desc = "Harpoon Buffer 4", + }, + { + "5", + function() + require("harpoon"):list():select(5) + end, + desc = "Harpoon Buffer 5", + }, }, opts = { - global_settings = { - mark_branch = true, + menu = { + width = vim.api.nvim_win_get_width(0) - 4, }, - width = vim.api.nvim_win_get_width(0) - 4, }, - config = function() - require("harpoon").setup() - require("telescope").load_extension("harpoon") - end, }