A Neovim plugin to show diff between merge conflicts.
- Automatic conflict detection on file open
- Diff3 support (shows base/ancestor)
- Works with standard merge conflicts (no diff3)
- Floating window diff display
| Command | Description |
|---|---|
:MergeDiffOurs |
Show diff of ours → base (diff3 only) |
:MergeDiffTheirs |
Show diff of theirs → base (diff3 only) |
:MergeDiffBoth |
Show both diffs in floating window (diff3 only) |
:MergeDiffOursTheirs |
Show diff ours → theirs (works without diff3) |
:MergeDiffTheirsOurs |
Show diff theirs → ours (works without diff3) |
{
"nvim-merge-diff",
config = function()
require("merge-diff").setup()
end,
}- Clone this repository to your plugin directory
- Run
:MergeDiffSetupto configure
require("merge-diff").setup({
-- Marker patterns (default)
markers = {
ours = "^<<<<<<<+",
theirs = "^>>>>>>>+",
ancestor = "^|||||||+",
separator = "^=======+$",
},
})- Open a file with merge conflicts
- Position cursor on any line within the conflict
- Run any
:MergeDiff*command
- Neovim 0.10+
diffcommand (optional:deltafor better formatting)