[英]How to configure highlighting in Emacs diff mode?
我在Emacs中使用mercurial.el
模式。 当我运行vc-diff
,我可以看到差异,但是,与源代码不同,它没有很好地突出显示:
阅读这些差异很困难。 我如何配置Emacs,
-
和+
不同颜色的线条? (例如红色和蓝色) 尝试使用Mx ediff-revision ,它执行ediff
而不仅仅是常规diff。 这将为您提供单词差异和并排(或顶部/底部)显示。 查看ediff手册 。
Emacs wiki还有许多模式可用于常规差异文件(就像你正在查看的那样) - 检查出来 。
要更改您当前使用的diff-mode
的颜色,您可以执行以下操作:
(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))
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.