/emacs-vdiff-magit

Magit integration for vdiff

Primary LanguageEmacs LispGNU General Public License v3.0GPL-3.0

vdiff-magit

Table of Contents

Introduction

The purpose of this Emacs package is to integrate vdiff into magit, replacing ediff.

Installation and Usage

vdiff-magit is available on MELPA, which is the recommended way to install it and keep it up to date. To install it you may do M-x package-install RET vdiff RET.

Magit integration details

Loading vdiff-magit will pull in functions that will allow vdiff to be used with magit. In order to use these functions you need to call the vdiff functions instead of the magit-ediff ones. Here is a very basic setup which replaces the basic ediff key bindings in magit.

(require 'vdiff-magit)
(define-key magit-mode-map "e" 'vdiff-magit-dwim)
(define-key magit-mode-map "E" 'vdiff-magit-popup)
(setcdr (assoc ?e (plist-get magit-dispatch-popup :actions))
        '("vdiff dwim" 'vdiff-magit-dwim))
(setcdr (assoc ?E (plist-get magit-dispatch-popup :actions))
        '("vdiff popup" 'vdiff-magit-popup))
;; This flag will default to using ediff for merges. vdiff-magit does not yet
;; support 3-way merges. Please see the docstring of this variable for more
;; information
;; (setq vdiff-magit-use-ediff-for-merges nil)

;; Whether vdiff-magit-dwim runs show variants on hunks.  If non-nil,
;; vdiff-magit-show-staged or vdiff-magit-show-unstaged are called based on what
;; section the hunk is in.  Otherwise, vdiff-magit-dwim runs vdiff-magit-stage
;; when point is on an uncommitted hunk.  (setq vdiff-magit-dwim-show-on-hunks
;; nil)

;; Whether vdiff-magit-show-stash shows the state of the index.
;; (setq vdiff-magit-show-stash-with-index t)

;; Only use two buffers (working file and index) for vdiff-magit-stage
;; (setq vdiff-magit-stage-is-2way nil)