Config harpoon myself

This commit is contained in:
Marcelo Jacobus 2025-03-14 10:11:09 -03:00
parent fe2b8eeb89
commit dbb97de380
2 changed files with 43 additions and 1 deletions

View file

@ -38,7 +38,7 @@ local plugins = {
{ import = "lazyvim.plugins.extras.ui.treesitter-context" },
{ import = "lazyvim.plugins.extras.editor.telescope" },
{ import = "lazyvim.plugins.extras.editor.harpoon2" },
-- { import = "lazyvim.plugins.extras.editor.harpoon2" },
{ import = "lazyvim.plugins.extras.editor.refactoring" },
{ import = "lazyvim.plugins.extras.editor.aerial" }, -- <leader>ss list constants
{ import = "lazyvim.plugins.extras.editor.dial" }, -- like speadating

42
lua/plugins/harpoon.lua Normal file
View file

@ -0,0 +1,42 @@
return {
"ThePrimeagen/harpoon",
branch = "harpoon2",
opts = {
menu = {
width = vim.api.nvim_win_get_width(0) - 4,
},
settings = {
save_on_toggle = true,
},
},
keys = function()
local keys = {
{
"<leader>H",
function()
require("harpoon"):list():add()
end,
desc = "Harpoon File",
},
{
"<leader>h",
function()
local harpoon = require("harpoon")
harpoon.ui:toggle_quick_menu(harpoon:list())
end,
desc = "Harpoon Quick Menu",
},
}
for i = 1, 9 do
table.insert(keys, {
"<leader>" .. i,
function()
require("harpoon"):list():select(i)
end,
desc = "Harpoon to File " .. i,
})
end
return keys
end,
}