在Emacs ido模式下更改颜色

时间:2011-12-12 13:10:48

标签: emacs

我已经安装了Emacs-starter-kit(https://github.com/technomancy/emacs-starter-kit/),并且我已经自定义了配色方案。 但是在迷你缓冲器中(在ido模式下,默认情况下是Emacs-starter-kit),红色看起来不同。 screenshot http://xmages.net/storage/10/1/0/5/5/upload/7133d11f.jpg 如何在ido迷你缓冲区中自定义颜色并使其外观与常规缓冲区相同? 感谢。

3 个答案:

答案 0 :(得分:7)

以下是ido的面孔以及我如何在我的.emacs中设置它们:

(custom-set-faces
 '(ido-subdir ((t (:foreground "#66ff00")))) ;; Face used by ido for highlighting subdirs in the alternatives.
 '(ido-first-match ((t (:foreground "#ccff66")))) ;; Face used by ido for highlighting first match.
 '(ido-only-match ((t (:foreground "#ffcc33")))) ;; Face used by ido for highlighting only match.
 '(ido-indicator ((t (:foreground "#ffffff")))) ;; Face used by ido for highlighting its indicators (don't actually use this)
 '(ido-incomplete-regexp ((t (:foreground "#ffffff")))) ;; Ido face for indicating incomplete regexps. (don't use this either)

我通过 M-x set-face-foreground RET 找到它们,然后输入“ido-”并使用完成来获取可用的面部名称。

使用 M-x customize-face然后使用上面的完成来使用简单的界面自定义面部可能更简单。

答案 1 :(得分:2)

您可以使用自定义ido面孔 中号 - X customize-group RET ido RET 然后搜索face

答案 2 :(得分:2)

查找可用面孔(set-face-foreground)的更好方法是list-faces-display

你也可以让Emacs做自定义工作,然后将代码 - 从 .emacs 的EOF中相当无能的位置移动到字体钩子中:

(add-hook 'after-init-hook 'global-font-lock-mode)
(add-hook 'font-lock-mode-hook
          '(lambda()
             (custom-set-faces
                 .
                 .

恕我直言,这是启用字体锁定的最佳和最清晰的方法。

global-font-lock-mode将在所有缓冲区中启用字体锁定。以交互方式调用此(自动加载)功能以切换字体锁定。