A small plugin for neovim to be able to view the changes between parts of a git conflict using [:h diffsplit]
- Neovim >= 0.5.0
Plug 'ExuCounter/diff_conflict_parts.nvim'use {
'ExuCounter/diff_conflict_parts.nvim'
}require("lazy").setup {
"ExuCounter/diff_conflict_parts.nvim"
}local diff_conflict_parts = require("diff_conflict_parts")
diff_conflict_parts.setup()Configuration can be passed to the setup function. At this point you can only set up how, in which direction will open the diff.
require('diff_conflict_parts').setup({
direction = "horizontal" -- "horizontal" or "vertical"
})The plugin supports both styles of git conflicts - the default "merge" and "diff3". It provides only 3 commands without any default mappings.
:DiffHeadTheir
:DiffHeadParent
:DiffParentTheirEach of the commands looks to see if our cursor is inside a conflict, and if so, opens parts of the conflict in the two splits (head and parent for example) and compares them via [:h diffsplit]
Note that DiffParentTheir and DiffHeadParent operate only in "diff3" mode (merge-config-documentation)