Skip to content

justbur/emacs-vdiff-magit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 

Repository files navigation

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)
(transient-suffix-put 'magit-dispatch "e" :description "vdiff (dwim)")
(transient-suffix-put 'magit-dispatch "e" :command 'vdiff-magit-dwim)
(transient-suffix-put 'magit-dispatch "E" :description "vdiff")
(transient-suffix-put 'magit-dispatch "E" :command 'vdiff-magit)

;; This flag will default to using ediff for merges.
;; (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)