vim.harpoon

Automate file navigation in Neovim using Harpoon marks and keybindings.

4|Updated Sep 25, 2024
One-click install
npx skills add https://github.com/khulnasoft/init.lua --skill vim-harpoon
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: vim.harpoon
Source: https://github.com/khulnasoft/init.lua/tree/main/skills/vim.harpoon
Command: npx skills add https://github.com/khulnasoft/init.lua --skill vim-harpoon

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Harpoon enables rapid context switching by bookmarking current files and providing a quick menu, reducing context-switching overhead during coding sessions.

Core Features & Use Cases

  • Add current file to Harpoon list with <leader>a.
  • Prepend current file to Harpoon list with <leader>A.
  • Toggle Harpoon quick menu with <C-e>.
  • Jump to file 1–4 using <C-h>/<C-t>/<C-n>/<C-s>.
  • Replace marks at slots 1–4 with <leader><C-h>/<leader><C-t>/<leader><C-n>/<leader><C-s>.
  • API reference: harpoon:list():add(), harpoon:list():select(index), harpoon.ui:toggle_quick_menu(harpoon:list()).

Quick Start

Add the current file to Harpoon and use the quick menu to jump between marked files.

Frequently Asked Questions about vim.harpoon

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I switch between files quickly in Neovim?

Fast file switching in Neovim uses Harpoon marks to bookmark a curated set of files, reducing context-switching overhead. You can add the current file to a list and jump to specific slots using keybindings.

What is the best way to manage file navigation for a stable set of project files?

File navigation for a stable set of files is managed by bookmarking them with Harpoon marks. You can toggle a quick menu UI to view and select files, or use direct keybindings to jump to slots 1 through 4.

How do I add and jump to bookmarked files in vim?

To add and jump to bookmarked files in vim, mark the current file with <leader>a and toggle the quick menu with <C-e>. You can also prepend files with <leader>A or replace marks at slots 1-4 using leader key combinations.

Does Harpoon support replacing marks at specific file navigation slots?

Yes, Harpoon supports replacing marks at specific file navigation slots. You can replace marks at slots 1 through 4 using the <leader> key combined with <C-h>, <C-t>, <C-n>, or <C-s>.

Can I use the Harpoon Lua API to automate file switching workflows?

Yes, you can use the Harpoon Lua API to automate file switching workflows. The API provides methods like harpoon:list():add(), harpoon:list():select(index), and harpoon.ui:toggle_quick_menu(harpoon:list()) for programmatic navigation.