emacs-vdiff-magit icon indicating copy to clipboard operation
emacs-vdiff-magit copied to clipboard

Magit integration for vdiff

  • vdiff-magit

** Table of Contents :TOC:

  • [[#vdiff-magit][vdiff-magit]]
    • [[#introduction][Introduction]]
    • [[#installation-and-usage][Installation and Usage]]
    • [[#magit-integration-details][Magit integration details]]

** Introduction

The purpose of this Emacs package is to integrate [[https://github.com/justbur/emacs-vdiff][vdiff]] into [[https://github.com/magit/magit][magit]], replacing ediff.

** Installation and Usage

vdiff-magit is available on [[https://melpa.org/][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 [[https://github.com/magit/magit][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.

#+BEGIN_SRC emacs-lisp (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) #+END_SRC