Skip to content

Commit 65bab0b

Browse files
committed
Add harpoon2 to neovim config
Add Harpoon2 plugin to Neovim configuration and integrate it with Telescope and Which-Key. * Add `ThePrimeagen/harpoon` plugin to `lua/custom/plugins/init.lua` with branch `harpoon2` and configure it. * Add keybindings for Harpoon commands in `init.lua`. * Integrate Harpoon with Telescope by creating a custom picker for Harpoon marks and adding keybindings to open the custom picker. * Integrate Harpoon with Which-Key by adding commands to the Which-Key menu and creating keybindings for adding, navigating, and removing Harpoon marks. --- For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/sebbii17/kickstart.nvim?shareId=XXXX-XXXX-XXXX-XXXX).
1 parent 268b0b4 commit 65bab0b

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

init.lua

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,7 @@ require('lazy').setup({
321321
{ '<leader>w', group = '[W]orkspace' },
322322
{ '<leader>t', group = '[T]oggle' },
323323
{ '<leader>h', group = 'Git [H]unk', mode = { 'n', 'v' } },
324+
{ '<leader>m', group = '[M]arks' },
324325
},
325326
},
326327
},
@@ -434,6 +435,9 @@ require('lazy').setup({
434435
vim.keymap.set('n', '<leader>sn', function()
435436
builtin.find_files { cwd = vim.fn.stdpath 'config' }
436437
end, { desc = '[S]earch [N]eovim files' })
438+
439+
-- Custom picker for Harpoon marks
440+
vim.keymap.set('n', '<leader>sm', require('harpoon.ui').toggle_quick_menu, { desc = '[S]earch [M]arks' })
437441
end,
438442
},
439443

@@ -1008,5 +1012,12 @@ require('lazy').setup({
10081012
},
10091013
})
10101014

1015+
-- Harpoon keybindings
1016+
vim.keymap.set('n', '<leader>ma', require('harpoon.mark').add_file, { desc = '[M]ark [A]dd file' })
1017+
vim.keymap.set('n', '<leader>mm', require('harpoon.ui').toggle_quick_menu, { desc = '[M]ark [M]enu' })
1018+
vim.keymap.set('n', '<leader>mn', require('harpoon.ui').nav_next, { desc = '[M]ark [N]ext' })
1019+
vim.keymap.set('n', '<leader>mp', require('harpoon.ui').nav_prev, { desc = '[M]ark [P]revious' })
1020+
vim.keymap.set('n', '<leader>md', require('harpoon.mark').rm_file, { desc = '[M]ark [D]elete file' })
1021+
10111022
-- The line beneath this is called `modeline`. See `:help modeline`
10121023
-- vim: ts=2 sts=2 sw=2 et

lua/custom/plugins/init.lua

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,15 @@ return {
1515
opts = {},
1616
dependencies = { 'nvim-tree/nvim-web-devicons' }, -- use if prefer nvim-web-devicons
1717
},
18+
{
19+
'ThePrimeagen/harpoon',
20+
branch = 'harpoon2',
21+
config = function()
22+
require('harpoon').setup({
23+
menu = {
24+
width = vim.api.nvim_win_get_width(0) - 4,
25+
}
26+
})
27+
end,
28+
},
1829
}

0 commit comments

Comments
 (0)