I use mercurial.el
mode with Emacs. When I run vc-diff
, I can see the diff, but, unlike the source code, it is not nicely highlighted:
Reading such diffs is difficult. How do I configure Emacs,
-
and +
lines with different colors? (red and blue, for example)Try using M-x ediff-revision, which does an ediff
instead of just a regular diff. That will give you word-differences and a side-by-side (or top/bottom) display. Check out the ediff manual.
The Emacs wiki also has a number of modes for just regular diff files (like what you're looking at) - check it out.
To just change the colors in the diff-mode
which you're currently using, you can do something like:
(defun update-diff-colors ()
"update the colors for diff faces"
(set-face-attribute 'diff-added nil
:foreground "white" :background "blue")
(set-face-attribute 'diff-removed nil
:foreground "white" :background "red3")
(set-face-attribute 'diff-changed nil
:foreground "white" :background "purple"))
(eval-after-load "diff-mode"
'(update-diff-colors))
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With