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

@@ -40,7 +40,7 @@
"gen.nvim": { "branch": "main", "commit": "2cb643b1a827bcdfc665a37d5f8174249d2d5bf5" },
"gh.nvim": { "branch": "main", "commit": "3181973d0c80fe0553e30e0aeeb860bedef9a33b" },
"gitsigns.nvim": { "branch": "main", "commit": "4e348641b8206c3b8d23080999e3ddbe4ca90efc" },
"harpoon": { "branch": "master", "commit": "ccae1b9bec717ae284906b0bf83d720e59d12b91" },
"harpoon": { "branch": "harpoon2", "commit": "a38be6e0dd4c6db66997deab71fc4453ace97f9c" },
"highlight-undo.nvim": { "branch": "main", "commit": "50a6884a8476be04ecce8f1c4ed692c5000ef0a1" },
"inc-rename.nvim": { "branch": "main", "commit": "6f9b5f9cb237e12935144cdc535322b8c93c1b25" },
"indent-blankline.nvim": { "branch": "master", "commit": "3d08501caef2329aba5121b753e903904088f7e6" },

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,
}