A lightweight, feature-rich merge conflict manager for Neovim, written in Lua.
unclash.nvim automatically detects, highlights, and helps you resolve merge conflicts with ease. It includes a 3-way merge editor, clickable actions, and seamless integration with existing tools.
- Automatic Detection: Automatically detects conflicted files in your working directory and highlights them when opened.
- More than git: Works with any text file containing standard conflict markers (
<<<<<<<,=======,>>>>>>>). - Smart Highlighting: Distinct highlighting for Current, Incoming, and Base changes to easily visualize conflicts.
- Action Lines: Virtual text buttons above each conflict allowing you to resolve them with a mouse click (
[Accept Current],[Accept Incoming], etc.). - 3-Way Merge Editor: Opens a specialized tab layout with the Result, Current, and Incoming views side-by-side.
- Navigation: Jump between conflicts easily.
- Quickfix / Trouble Integration: Populate the quickfix list or Trouble.nvim with all detected conflicts.
- Snacks Picker Integration: Browse and preview all workspace conflicts with snacks.nvim picker.
{
"madmaxieee/unclash.nvim",
lazy = false,
-- default options
opts = {
action_buttons = {
enabled = true,
},
annotations = {
enabled = true,
},
},
keys = {
{ "]x", function() require("unclash").next_conflict() end, desc = "Next Conflict" },
{ "[x", function() require("unclash").prev_conflict() end, desc = "Prev Conflict" },
{ "<leader>co", function() require("unclash").open_merge_editor() end, desc = "Open Merge Editor" },
{ "<leader>cc", function() require("unclash").accept_current() end, desc = "Accept Current" },
{ "<leader>ci", function() require("unclash").accept_incoming() end, desc = "Accept Incoming" },
{ "<leader>cb", function() require("unclash").accept_both() end, desc = "Accept Both" },
{ "<leader>fx", function() require("unclash.snacks").pick() end, desc = "Pick Conflicts" },
},
}unclash.nvim works out of the box. Just open a file with conflict markers.
| Command | Description |
|---|---|
UnclashAcceptCurrent |
Accept the "Current" changes for the conflict under the cursor. |
UnclashAcceptIncoming |
Accept the "Incoming" changes for the conflict under the cursor. |
UnclashAcceptBoth |
Accept both changes for the conflict under the cursor. |
UnclashOpenMergeEditor |
Open the 3-way merge editor for the current file. |
UnclashQf |
Add all conflicts in the workspace to the Quickfix list. |
UnclashTrouble |
Show all conflicts using Trouble.nvim. |
UnclashPick |
Open the snacks picker to browse and preview all workspace conflicts. |
unclash.nvim does not set default keybindings (except for mouse clicks on action lines). You can set your own mapping in your config:
local unclash = require("unclash")
vim.keymap.set("n", "]x", unclash.next_conflict, { desc = "Next Conflict" })
vim.keymap.set("n", "[x", unclash.prev_conflict, { desc = "Prev Conflict" })
vim.keymap.set("n", "<leader>co", unclash.open_merge_editor, { desc = "Open Merge Editor" })
-- Helper to accept conflicts
vim.keymap.set("n", "<leader>cc", unclash.accept_current, { desc = "Accept Current" })
vim.keymap.set("n", "<leader>ci", unclash.accept_incoming, { desc = "Accept Incoming" })
vim.keymap.set("n", "<leader>cb", unclash.accept_both, { desc = "Accept Both" })
-- Snacks picker for all workspace conflicts
vim.keymap.set("n", "<leader>cx", function()
require("unclash.snacks").pick()
end, { desc = "Pick Conflicts" })When you run :UnclashOpenMergeEditor or click [Open Merge Editor]:
- A new tab opens.
- The Result buffer (the actual file) is on the left (or top depending on layout).
- Current Changes and Incoming Changes are displayed in split windows for comparison.
- Updates to the conflict in the Result buffer will close the editor automatically when resolved.
The plugin defines the following highlight groups, which link to standard diff groups by default:
UnclashCurrent: Background for current changes (Links toDiffAdd)UnclashIncoming: Background for incoming changes (Links toDiffText)UnclashBase: Background for base changes (Links toDiffChange)UnclashAnnotation: Text color for annotations (Links toNonText)
You can override these in your color scheme or config.

