Skip to content

A small neovim plugin to be able to view the changes between parts of a git conflict

License

Notifications You must be signed in to change notification settings

ExuCounter/diff_conflict_parts.nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

A small plugin for neovim to be able to view the changes between parts of a git conflict using [:h diffsplit]

Requirements

  • Neovim >= 0.5.0

Install

vim-plug

Plug 'ExuCounter/diff_conflict_parts.nvim'

packer.nvim

use {
  'ExuCounter/diff_conflict_parts.nvim'
}

lazy.nvim

require("lazy").setup {
  "ExuCounter/diff_conflict_parts.nvim"
}

Setup:

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"
})

Usage:

The plugin supports both styles of git conflicts - the default "merge" and "diff3". It provides only 3 commands without any default mappings.

:DiffHeadTheir
:DiffHeadParent
:DiffParentTheir

Each 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)

About

A small neovim plugin to be able to view the changes between parts of a git conflict

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages