Harpoon Extra
editor.harpoon installs Harpoon v2
and calls require("harpoon"):setup({}), which Harpoon requires for its
autocmds and persistence hooks.
Enable it
Section titled “Enable it”return { extras = { enabled = { "editor.harpoon", }, },}Because this extra adds a plugin, run:
:BlakExtras syncWhat it adds
Section titled “What it adds”| Surface | Contribution |
|---|---|
| Plugin | ThePrimeagen/harpoon on branch harpoon2 |
| Dependencies | plenary.nvim |
| Setup | require("harpoon"):setup({}) |
| Keymap | <leader>ha adds the current file |
| Keymap | <leader>hh toggles the Harpoon quick menu |
| Keymap | <leader>hp / <leader>hn jumps previous / next |
| Keymap | <leader>h1 through <leader>h4 jumps to marked files |
The keymaps appear in :BlakKeys.
Use it
Section titled “Use it”<leader>ha<leader>hh<leader>h1The quick menu is Harpoon’s editable list UI. Press <CR> on a line to open
that file. Reorder or delete lines, then :w to apply the edits. With Harpoon’s
defaults, closing the menu with q, <Esc>, or <leader>hh discards unsaved
edits; set settings.save_on_toggle = true (below) to apply them on close.
Configure Harpoon
Section titled “Configure Harpoon”Blak keeps Harpoon on its upstream defaults. To pass setup options, add a
matching lazy.nvim spec in plugins.specs; lazy.nvim merges it with the extra’s
plugin spec:
return { extras = { enabled = { "editor.harpoon" }, }, plugins = { specs = { { "ThePrimeagen/harpoon", opts = { settings = { save_on_toggle = true, sync_on_ui_close = true, }, }, }, }, },}Disable it
Section titled “Disable it”:BlakExtras disable editor.harpoon:BlakExtras syncRestart Blak to unload mappings and runtime hooks that already ran in the current session.