我在Emacs中使用mercurial.el
模式。当我运行vc-diff
时,我可以看到diff,但是与源代码不同,它没有很好地突出显示:
读取这样的差异是困难的。如何配置Emacs,
-
和+
行? (例如红色和蓝色)最佳答案
尝试使用M-x ediff-revision,它执行 ediff
而不是常规的diff。这将为您提供字词差异和并排(或顶部/底部)显示。 checkout ediff manual。
Emacs Wiki还为普通的diff文件(如您所查看的)-check it out提供了多种模式。
要仅更改当前使用的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))
关于version-control - 如何在Emacs差异模式下配置突出显示?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4079830/