https://github.com/StackInTheWild/headhunter.nvim
Hunt and resolve merge conflicts directly in Neovim — fast and simple.
https://github.com/StackInTheWild/headhunter.nvim
lua neovim nvim nvim-lua nvim-plugin
Last synced: 3 months ago
JSON representation
Hunt and resolve merge conflicts directly in Neovim — fast and simple.
- Host: GitHub
- URL: https://github.com/StackInTheWild/headhunter.nvim
- Owner: StackInTheWild
- License: mit
- Created: 2025-09-12T18:56:28.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2025-09-22T04:19:32.000Z (3 months ago)
- Last Synced: 2025-09-22T06:16:23.930Z (3 months ago)
- Topics: lua, neovim, nvim, nvim-lua, nvim-plugin
- Language: Lua
- Homepage:
- Size: 13.7 KB
- Stars: 50
- Watchers: 1
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-neovim - StackInTheWild/headhunter.nvim - Hunt and resolve merge conflicts directly in Neovim — fast and simple. (Git / Quickfix)
- awesome-neovim-sorted - StackInTheWild/headhunter.nvim
README
# headhunter.nvim
A Neovim plugin that helps you quickly **navigate and resolve merge conflicts** with customizable keybindings.
---
## ✨ Features
- Jump directly to the **next or previous conflict** in your repository.
- Quickly resolve conflicts using simple keybindings:
- **Take HEAD** (`<<<<<<< HEAD`) – keeps your local changes.
- **Take origin** (`>>>>>>> ...`) – keeps the incoming changes.
- **Take both** – keeps both changes, concatenated in order.
- Minimal and fast — pure Lua implementation with no external dependencies.
- Fully customizable keybindings to fit your workflow.
---
## 📦 Installation
### Using [lazy.nvim](https://github.com/folke/lazy.nvim)
```lua
{
"StackInTheWild/headhunter.nvim",
lazy = true,
opts = {
register_keymaps = false, -- Disable internal keymaps if using lazy.nvim keys
},
keys = {
{ "]g", ":HeadhunterNext", desc = "Go to next Conflict" },
{ "[g", ":HeadhunterPrevious", desc = "Go to previous Conflict" },
{ "gh", ":HeadhunterTakeHead", desc = "Take changes from HEAD" },
{ "go", ":HeadhunterTakeOrigin", desc = "Take changes from origin" },
{ "gb", ":HeadhunterTakeBoth", desc = "Take both changes" },
},
}
```
---
## 🚀 Usage
Assuming you are using the keybindings from above:
### Navigate Conflicts
- `[g` → Jump to the previous conflict.
- `]g` → Jump to the next conflict.
### Resolve Conflicts
Given a conflict block like this:
```
<<<<<<< HEAD
my changes
=======
their changes
>>>>>>> branch
```
| Action | Keybinding | Command | Resulting Text in Buffer |
| ----------- | ------------ | ----------------------- | ------------------------------- |
| Take HEAD | `gh` | `:HeadhunterTakeHead` | `my changes` |
| Take origin | `go` | `:HeadhunterTakeOrigin` | `their changes` |
| Take both | `gb` | `:HeadhunterTakeBoth` | `my changes`
`their changes` |
_Notes:_
- Take HEAD keeps only your local changes.
- Take origin keeps only the incoming changes from the other branch.
- Take both concatenates your changes with the incoming changes, in that order.
---
## 🧪 Testing
We use plenary.nvim
```sh
make test
```