chore(nvim): upgrade to Harpoon 2

This commit is contained in:
Stefan Imhoff
2024-03-16 10:51:13 +01:00
parent 3509d1d3b7
commit 83adac340c
3 changed files with 55 additions and 16 deletions

View File

@@ -18,6 +18,7 @@ require("lazy").setup({
{ import = "lazyvim.plugins.extras.coding.copilot" },
{ import = "lazyvim.plugins.extras.dap.core" },
{ import = "lazyvim.plugins.extras.editor.aerial" },
{ import = "lazyvim.plugins.extras.editor.harpoon2" },
{ import = "lazyvim.plugins.extras.formatting.prettier" },
{ import = "lazyvim.plugins.extras.lang.json" },
{ import = "lazyvim.plugins.extras.lang.ruby" },

View File

@@ -2,24 +2,62 @@
-- https://github.com/ThePrimeagen/harpoon
return {
"ThePrimeagen/harpoon",
dependencies = "nvim-telescope/telescope.nvim",
-- stylua: ignore
branch = "harpoon2",
keys = {
{ "<leader>a", function() require("harpoon.mark").add_file() end, desc = "Harpoon Add File" },
{ "<leader>;", function() require("harpoon.ui").toggle_quick_menu() end, desc = "Harpoon Toggle Quickmenu" },
{ "<leader>1", function() require("harpoon.ui").nav_file(1) end, desc = "Harpoon Buffer 1" },
{ "<leader>2", function() require("harpoon.ui").nav_file(2) end, desc = "Harpoon Buffer 2" },
{ "<leader>3", function() require("harpoon.ui").nav_file(3) end, desc = "Harpoon Buffer 3" },
{ "<leader>4", function() require("harpoon.ui").nav_file(4) end, desc = "Harpoon Buffer 4" },
{
"<leader>a",
function()
require("harpoon"):list():append()
end,
desc = "Harpoon Add File",
},
{
"<leader>;",
function()
local harpoon = require("harpoon")
harpoon.ui:toggle_quick_menu(harpoon:list())
end,
desc = "Harpoon Quickmenu",
},
{
"<leader>1",
function()
require("harpoon"):list():select(1)
end,
desc = "Harpoon Buffer 1",
},
{
"<leader>2",
function()
require("harpoon"):list():select(2)
end,
desc = "Harpoon Buffer 2",
},
{
"<leader>3",
function()
require("harpoon"):list():select(3)
end,
desc = "Harpoon Buffer 3",
},
{
"<leader>4",
function()
require("harpoon"):list():select(4)
end,
desc = "Harpoon Buffer 4",
},
{
"<leader>5",
function()
require("harpoon"):list():select(5)
end,
desc = "Harpoon Buffer 5",
},
},
opts = {
global_settings = {
mark_branch = true,
menu = {
width = vim.api.nvim_win_get_width(0) - 4,
},
width = vim.api.nvim_win_get_width(0) - 4,
},
config = function()
require("harpoon").setup()
require("telescope").load_extension("harpoon")
end,
}