diff options
| author | Naz <ndpm13@ch-naseem.com> | 2025-02-08 11:53:19 +0100 |
|---|---|---|
| committer | Naz <ndpm13@ch-naseem.com> | 2025-02-08 11:53:19 +0100 |
| commit | 90a657be8b080c3d3c5cacab50273109f1d7ff54 (patch) | |
| tree | b76be8b56876092b170d8d075c351f657a9ecd9e | |
| parent | 428dc356c8e5ca5a5d940bc770a5da34fdd59135 (diff) | |
✨feat: add ThePrimeagen/harpoon plugin
| -rw-r--r-- | lua/config/mappings.lua | 17 | ||||
| -rw-r--r-- | lua/plugins/harpoon.lua | 5 |
2 files changed, 22 insertions, 0 deletions
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" }, "<leader>ca", vim.lsp.buf.code_action, { desc = "LSP Code Action" }) vim.keymap.set("n", "<leader>gf", vim.lsp.buf.format, { desc = "LSP Format" }) + +-- harpoon keymaps + +vim.keymap.set("n", "<leader>a", function() + require("harpoon"):list():add() +end, { desc = "Harpoon Add" }) +vim.keymap.set("n", "<leader>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", "<leader><S-P>", function() + require("harpoon"):list():prev() +end, { desc = "Harpoon Previous" }) +vim.keymap.set("n", "<leader><S-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" }, +} |
