Enhanced diff display with external tools.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Campbell Barton c4f350da43 Cleanup: sharp-quote function 2 months ago
.elisp-autofmt Initial diff-ansi. 8 months ago
LICENSE Initial diff-ansi. 8 months ago
changelog.rst Release v0.02 (add changelog) 3 months ago
diff-ansi.el Cleanup: sharp-quote function 2 months ago
readme.rst Update screenshot URL 3 months ago



Integrate external diff commands into Emacs for improved visualization.

Available via melpa.


This package aims to expose the best possible diff rendering, to save time and improve reading diff's in Emacs!

When reading diff's, features such as side-by-side display, word-level changes and syntax highlighting can help understanding the changes that have been made.

3rd party tools are available that support these features - this package aims to make those accessible within Emacs.

Screenshot of the diff-ansi used in Magit's log view.


Currently there are two main uses for this package.

  • You may run diff-ansi-buffer to display the current diff buffer.
  • Enable diff-ansi-mode minor mode which installs hooks to use enhanced diff display for Magit's revision display.



Create a new read-only buffer displaying diff contents from the current buffer.


Enable a minor mode to use diff-ansi functionality where possible.


diff-ansi-tool: 'delta

The external tool to use for displaying diffs.

  • 'delta supports side-by-side view, word level differences and syntax highlighting.
  • 'diff-so-fancy supports word level differences.
  • 'ydiff supports side-by-side view & word level differences.
  • 'custom call a custom command using (diff-ansi-tool-custom).

Additional arguments to pass to delta.


Additional arguments to pass to delta.


The command to use when diff-ansi-tool is set to 'custom.


Use diff-ansi when viewing commits in magit.


The background color of this face is used when no color is specified.

Advanced Customization

Note that in general these settings can be left as-is, but may be extended to adjust default behavior.

diff-ansi-method: 'multiprocess

Method used for decoding ANSI sequences.

  • 'immediate to convert immediate (blocking may be slow).
  • 'progressive uses a timer (avoids blocking input).
  • 'multiprocess to span multiple external processes for improved performance on large diffs.
diff-ansi-verbose-progress: nil

Display progress for progressive conversion in the echo area for when diff-ansi-method is set to progressive.

diff-ansi-chunks-size: 8192

The number of characters to process at a time for when diff-ansi-method is set to progressive or multiprocess.


The number of processes to run simultaneously when diff-ansi-method is set to multiprocess.


  • Converting ANSI escape sequences can be slow for large diffs, this is why multiprocess support is default to avoid long wait times viewing diffs.


The package is available in melpa as diff-ansi, here is an example with use-package:

(use-package diff-ansi
  :commands (diff-ansi-mode diff-ansi-buffer)))