A Neovim plugin that helps you quickly navigate and resolve merge conflicts with customizable keybindings.
<<<<<<< HEAD
) – keeps your local changes.>>>>>>> ...
) – keeps the incoming changes.{
"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" },
{ "<leader>gh", ":HeadhunterTakeHead", desc = "Take changes from HEAD" },
{ "<leader>go", ":HeadhunterTakeOrigin", desc = "Take changes from origin" },
{ "<leader>gb", ":HeadhunterTakeBoth", desc = "Take both changes" },
},
}
Assuming you are using the keybindings from above:
[g
→ Jump to the previous conflict.]g
→ Jump to the next conflict.Given a conflict block like this:
<<<<<<< HEAD
my changes
=======
their changes
>>>>>>> branch
Action | Keybinding | Command | Resulting Text in Buffer |
---|---|---|---|
Take HEAD | <leader>gh |
:HeadhunterTakeHead |
my changes |
Take origin | <leader>go |
:HeadhunterTakeOrigin |
their changes |
Take both | <leader>gb |
:HeadhunterTakeBoth |
my changes their changes |
Notes:
We use plenary.nvim
make test