From 7876fabd7c5c625194ee723972e63105eca4b505 Mon Sep 17 00:00:00 2001 From: Ibrahim Muftee Date: Thu, 3 Oct 2024 17:54:22 -0500 Subject: feat(nvim): neovim config rewrite --- dot_config/nvim/lua/plugins/harpoon.lua | 41 ++++++++++++++++++++++----------- 1 file changed, 28 insertions(+), 13 deletions(-) (limited to 'dot_config/nvim/lua/plugins/harpoon.lua') diff --git a/dot_config/nvim/lua/plugins/harpoon.lua b/dot_config/nvim/lua/plugins/harpoon.lua index 797abdd..695b69c 100644 --- a/dot_config/nvim/lua/plugins/harpoon.lua +++ b/dot_config/nvim/lua/plugins/harpoon.lua @@ -1,15 +1,30 @@ return { - "ThePrimeagen/harpoon", - dependencies = { - "nvim-lua/plenary.nvim", - }, - keys = { - { "a", function() require("harpoon.mark").add_file() end, desc = "Mark file with Harpoon" }, - { "", function() require("harpoon.ui").toggle_quick_menu() end, desc = "Open Harpoon menu" }, - { "j", function() require("harpoon.ui").nav_file(1) end, desc = "Open Harpoon file 1" }, - { "k", function() require("harpoon.ui").nav_file(2) end, desc = "Open Harpoon file 2" }, - { "l", function() require("harpoon.ui").nav_file(3) end, desc = "Open Harpoon file 3" }, - { ";", function() require("harpoon.ui").nav_file(4) end, desc = "Open Harpoon file 4" }, - }, - config = true + "ThePrimeagen/harpoon", + branch = "harpoon2", + dependencies = { "nvim-lua/plenary.nvim" }, + config = function() + local harpoon = require("harpoon") + harpoon:setup() + + vim.keymap.set("n", "a", function() + harpoon:list():add() + end, { desc = "Mark file with Harpoon" }) + + vim.keymap.set("n", "", function() + harpoon.ui:toggle_quick_menu(harpoon:list()) + end, { desc = "Open Harpoon menu" }) + + vim.keymap.set("n", "j", function() + harpoon:list():select(1) + end, { desc = "Open Harpoon file 1" }) + vim.keymap.set("n", "k", function() + harpoon:list():select(2) + end, { desc = "Open Harpoon file 2" }) + vim.keymap.set("n", "l", function() + harpoon:list():select(3) + end, { desc = "Open Harpoon file 3" }) + vim.keymap.set("n", ";", function() + harpoon:list():select(4) + end, { desc = "Open Harpoon file 4" }) + end, } -- cgit v1.2.3