added harpoon
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
"conform.nvim": { "branch": "master", "commit": "c2526f1cde528a66e086ab1668e996d162c75f4f" },
|
||||
"friendly-snippets": { "branch": "main", "commit": "6cd7280adead7f586db6fccbd15d2cac7e2188b9" },
|
||||
"gitsigns.nvim": { "branch": "main", "commit": "31217271a7314c343606acb4072a94a039a19fb5" },
|
||||
"harpoon": { "branch": "harpoon2", "commit": "87b1a3506211538f460786c23f98ec63ad9af4e5" },
|
||||
"indent-blankline.nvim": { "branch": "master", "commit": "005b56001b2cb30bfa61b7986bc50657816ba4ba" },
|
||||
"lazy.nvim": { "branch": "main", "commit": "306a05526ada86a7b30af95c5cc81ffba93fef97" },
|
||||
"lualine.nvim": { "branch": "master", "commit": "47f91c416daef12db467145e16bed5bbfe00add8" },
|
||||
|
||||
@@ -0,0 +1,52 @@
|
||||
return {
|
||||
{
|
||||
"ThePrimeagen/harpoon",
|
||||
branch = "harpoon2", -- IMPORTANT: use maintained version
|
||||
dependencies = { "nvim-lua/plenary.nvim" },
|
||||
config = function()
|
||||
local harpoon = require("harpoon")
|
||||
harpoon:setup()
|
||||
|
||||
-- Add current file
|
||||
vim.keymap.set("n", "<leader>ha", function()
|
||||
harpoon:list():add()
|
||||
end, { desc = "Harpoon add file" })
|
||||
|
||||
-- Toggle quick menu
|
||||
vim.keymap.set("n", "<leader>hm", function()
|
||||
harpoon.ui:toggle_quick_menu(harpoon:list())
|
||||
end, { desc = "Harpoon menu" })
|
||||
|
||||
-- Remove current file from harpoon
|
||||
vim.keymap.set("n", "<leader>hr", function()
|
||||
require("harpoon"):list():remove()
|
||||
end, { desc = "Harpoon: remove file" })
|
||||
|
||||
-- Jump to files
|
||||
vim.keymap.set("n", "<leader>1", function()
|
||||
harpoon:list():select(1)
|
||||
end)
|
||||
|
||||
vim.keymap.set("n", "<leader>2", function()
|
||||
harpoon:list():select(2)
|
||||
end)
|
||||
|
||||
vim.keymap.set("n", "<leader>3", function()
|
||||
harpoon:list():select(3)
|
||||
end)
|
||||
|
||||
vim.keymap.set("n", "<leader>4", function()
|
||||
harpoon:list():select(4)
|
||||
end)
|
||||
|
||||
-- Optional: cycle
|
||||
vim.keymap.set("n", "<C-S-P>", function()
|
||||
harpoon:list():prev()
|
||||
end)
|
||||
|
||||
vim.keymap.set("n", "<C-S-N>", function()
|
||||
harpoon:list():next()
|
||||
end)
|
||||
end,
|
||||
},
|
||||
}
|
||||
Reference in New Issue
Block a user