From 9640118aa7ca77a82df5c8c756eda6267ecbbef9 Mon Sep 17 00:00:00 2001 From: Karolis Arbaciauskas Date: Wed, 1 Jan 2025 20:39:59 +0200 Subject: [PATCH] Add harpoon plugin --- lua/custom/plugins/harpoon.lua | 35 ++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 lua/custom/plugins/harpoon.lua diff --git a/lua/custom/plugins/harpoon.lua b/lua/custom/plugins/harpoon.lua new file mode 100644 index 00000000..0f06264a --- /dev/null +++ b/lua/custom/plugins/harpoon.lua @@ -0,0 +1,35 @@ +return { + 'ThePrimeagen/harpoon', + branch = 'harpoon2', + dependencies = { 'nvim-lua/plenary.nvim' }, + keys = function() + local keys = { + { + 'H', + function() + require('harpoon'):list():add() + end, + desc = 'Harpoon File', + }, + { + 'h', + function() + local harpoon = require 'harpoon' + harpoon.ui:toggle_quick_menu(harpoon:list()) + end, + desc = 'Harpoon Quick Menu', + }, + } + + for i = 1, 5 do + table.insert(keys, { + '' .. i, + function() + require('harpoon'):list():select(i) + end, + desc = 'Harpoon to File ' .. i, + }) + end + return keys + end, +}