From 90a657be8b080c3d3c5cacab50273109f1d7ff54 Mon Sep 17 00:00:00 2001 From: Naz Date: Sat, 8 Feb 2025 11:53:19 +0100 Subject: =?UTF-8?q?=E2=9C=A8feat:=20add=20ThePrimeagen/harpoon=20plugin?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lua/config/mappings.lua | 17 +++++++++++++++++ lua/plugins/harpoon.lua | 5 +++++ 2 files changed, 22 insertions(+) create mode 100644 lua/plugins/harpoon.lua (limited to 'lua') diff --git a/lua/config/mappings.lua b/lua/config/mappings.lua index cc6d97b..4c8e849 100644 --- a/lua/config/mappings.lua +++ b/lua/config/mappings.lua @@ -39,3 +39,20 @@ vim.keymap.set("n", "gd", vim.lsp.buf.definition, { desc = "LSP Definition" }) vim.keymap.set("n", "er", vim.diagnostic.open_float, { desc = "LSP Diagnostics" }) vim.keymap.set({ "n", "v" }, "ca", vim.lsp.buf.code_action, { desc = "LSP Code Action" }) vim.keymap.set("n", "gf", vim.lsp.buf.format, { desc = "LSP Format" }) + +-- harpoon keymaps + +vim.keymap.set("n", "a", function() + require("harpoon"):list():add() +end, { desc = "Harpoon Add" }) +vim.keymap.set("n", "h", function() + require("harpoon").ui:toggle_quick_menu(builtin:list()) +end, { desc = "Harpoon Menu" }) + +-- Toggle previous & next buffers stored within Harpoon list +vim.keymap.set("n", "", function() + require("harpoon"):list():prev() +end, { desc = "Harpoon Previous" }) +vim.keymap.set("n", "", function() + require("harpoon"):list():next() +end, { desc = "Harpoon Next" }) diff --git a/lua/plugins/harpoon.lua b/lua/plugins/harpoon.lua new file mode 100644 index 0000000..c8aa32c --- /dev/null +++ b/lua/plugins/harpoon.lua @@ -0,0 +1,5 @@ +return { + "ThePrimeagen/harpoon", + branch = "harpoon2", + dependencies = { "nvim-lua/plenary.nvim" }, +} -- cgit v1.2.3