The Harpoon quick menu provides a visual interface for viewing, reordering, and navigating your marked files. It’s a floating window that displays all your marks and allows you to manage them interactively.
You can reorder marks by editing the text in the quick menu:
Open the quick menu
Enter insert mode (i or a)
Use Vim motions to move lines around (e.g., dd to delete, p to paste)
The new order is saved automatically
-- From ui.lua:59-70local function get_menu_items() local lines = vim.api.nvim_buf_get_lines(Harpoon_bufh, 0, -1, true) local indices = {} for _, line in pairs(lines) do if not utils.is_white_space(line) then table.insert(indices, line) end end return indicesend
Reordering marks in the UI is the easiest way to organize your workflow. Simply rearrange the lines to match your preferred navigation order.
The quick menu respects your save_on_toggle and save_on_change configuration:
-- From ui.lua:14-20local function close_menu(force_save) local global_config = harpoon.get_global_settings() if global_config.save_on_toggle or force_save then require("harpoon.ui").on_menu_save() end vim.api.nvim_win_close(Harpoon_win_id, true)end
save_on_toggle
When enabled, marks are saved to disk whenever you close the quick menu:
The quick menu uses custom highlight groups that you can configure:
HarpoonWindow - The main menu window
HarpoonBorder - The menu border
HarpoonCurrentFile - Highlights the currently active file
-- Example: Link to existing highlight groupsvim.cmd([[ highlight! link HarpoonWindow Normal highlight! link HarpoonBorder FloatBorder highlight! link HarpoonCurrentFile Visual]])
You can navigate to marks directly without opening the menu:
local ui = require("harpoon.ui")-- Navigate to mark 1ui.nav_file(1)-- Navigate to next mark in the listui.nav_next()-- Navigate to previous markui.nav_prev()
These functions are particularly useful for setting up quick keybindings: