How can I get more colors in emacs vc-diff?
Asked Answered
Z

2

8

I would like to have vc-diff colorize the output so that added lines are in one color and deleted ones in another. Using Emacs 23.1 and putty/xterm-256color (list-colors-display shows 256 colors and color themes and such works as expected).

This is how it looks right now:

alt text

Zuniga answered 9/12, 2009 at 21:41 Comment(0)
T
3

The package diff-mode-.el provides more colors.

You can customize the colors by either customizing the faces diff-indicator-removed and diff-indicator-added, or changing the variables diff-indicator-removed-face and diff-indicator-added-face to be faces whose colors/properties you like. There are also changed varieties of the face and variable.

Other packages for enhancing diff-mode can be found here.

Trigger answered 9/12, 2009 at 22:6 Comment(2)
Weird name and the default settings weren't the best but a good start. Thank you!Zuniga
Yah, I don't like the default colors of that package.Trigger
Z
16

To just modify the colors of the added and removed lines:

(custom-set-faces
 '(diff-added ((t (:foreground "Green"))) 'now)
 '(diff-removed ((t (:foreground "Red"))) 'now)
 )

See Treys answer for a more complete customization.

Zuniga answered 9/12, 2009 at 22:42 Comment(1)
+1 I totally missed the default coloring options. diff-mode- has some flair, but this totally works.Trigger
T
3

The package diff-mode-.el provides more colors.

You can customize the colors by either customizing the faces diff-indicator-removed and diff-indicator-added, or changing the variables diff-indicator-removed-face and diff-indicator-added-face to be faces whose colors/properties you like. There are also changed varieties of the face and variable.

Other packages for enhancing diff-mode can be found here.

Trigger answered 9/12, 2009 at 22:6 Comment(2)
Weird name and the default settings weren't the best but a good start. Thank you!Zuniga
Yah, I don't like the default colors of that package.Trigger

© 2022 - 2024 — McMap. All rights reserved.