Skip to main content
Harpoon is a Neovim plugin that solves a simple but critical problem: quickly navigating between the small set of files you’re actively working on. No more fuzzy finding, endless :bnext cycling, or trying to remember which buffer contains that file you were just editing.

Why Harpoon?

You’re working on a codebase and find yourself frequenting a small set of files. Fuzzy finders are powerful but slow you down when you know exactly where you want to go. Buffer navigation with :bnext and :bprev gets repetitive. Alternate file (CTRL-^) only works for two files. You need something better. Harpoon lets you mark files and navigate to them with persistent keybindings. Think of it as bookmarks on steroids - mark the files that matter, jump between them instantly, and maintain context across sessions.

Installation

Install Harpoon with your favorite plugin manager

Quickstart

Get up and running in under 2 minutes

File navigation

Learn how to mark and navigate between files

Configuration

Customize Harpoon to match your workflow

Key features

Persistent file marks

Marks are saved per project and automatically update their position within files as you edit. Unlike vim’s global marks, Harpoon marks are designed for project-based workflows.
-- Mark the current file
require("harpoon.mark").add_file()

-- Navigate to mark 1
require("harpoon.ui").nav_file(1)

Quick menu interface

View all your marked files in a popup menu where you can reorder, delete, or open them in splits and tabs.
-- Toggle the quick menu
require("harpoon.ui").toggle_quick_menu()
From the menu:
  • Press Enter to open a file
  • Press CTRL-V to open in a vertical split
  • Press CTRL-X to open in a horizontal split
  • Press CTRL-T to open in a new tab
  • Press q or ESC to close

Terminal management

Harpoon provides persistent terminals that integrate seamlessly with your workflow. Navigate between terminals, send commands, and maintain context just like with files.
-- Navigate to terminal 1 (creates it if it doesn't exist)
require("harpoon.term").gotoTerminal(1)

-- Send a command to terminal 1
require("harpoon.term").sendCommand(1, "npm test")

Tmux integration

Harpoon works out of the box with tmux, letting you navigate and send commands to tmux windows and panes.
-- Go to tmux window 1
require("harpoon.tmux").gotoTerminal(1)

-- Send command to tmux window 1
require("harpoon.tmux").sendCommand(1, "ls -la")

Quick example

Here’s the most common Harpoon workflow:
local mark = require("harpoon.mark")
local ui = require("harpoon.ui")

-- Mark your frequently used files
vim.keymap.set("n", "<leader>a", mark.add_file)

-- Open the quick menu
vim.keymap.set("n", "<C-e>", ui.toggle_quick_menu)

-- Navigate to specific marks
vim.keymap.set("n", "<C-h>", function() ui.nav_file(1) end)
vim.keymap.set("n", "<C-t>", function() ui.nav_file(2) end)
vim.keymap.set("n", "<C-n>", function() ui.nav_file(3) end)
vim.keymap.set("n", "<C-s>", function() ui.nav_file(4) end)

-- Cycle through marks
vim.keymap.set("n", "<C-S-P>", ui.nav_prev)
vim.keymap.set("n", "<C-S-N>", ui.nav_next)
Harpoon requires Neovim 0.5.0+ and plenary.nvim as a dependency.

What’s next?

Get started with Harpoon

Follow our quickstart guide to mark your first file and start navigating

Build docs developers (and LLMs) love