在 MIT X 窗口系统下使用 Emacs 时,你可以指定颜色。
我不喜欢默认颜色,会自定义一套配色。
以下是我在 .emacs 中设置的相关表达式:
;; Set cursor color (set-cursor-color "white") ;; Set mouse color (set-mouse-color "white") ;; Set foreground and background (set-foreground-color "white") (set-background-color "darkblue")
;;; 设置增量搜索与拖拽的高亮颜色 (set-face-foreground 'highlight "white") (set-face-background 'highlight "blue")
(set-face-foreground 'region "cyan") (set-face-background 'region "blue")
(set-face-foreground 'secondary-selection "skyblue") (set-face-background 'secondary-selection "darkblue")
;; 设置日历高亮颜色 (with-eval-after-load 'calendar (set-face-foreground 'diary "skyblue") (set-face-background 'holiday "slate blue") (set-face-foreground 'holiday "white"))
各种蓝色调看着更舒适,也能减少屏幕闪烁带来的视觉疲劳。
另外,我也可以在各类 X 初始化文件中进行设置。例如,在 ~/.Xresources 文件中设置前景、背景、光标和指针(鼠标)颜色:
Emacs*foreground: white Emacs*background: darkblue Emacs*cursorColor: white Emacs*pointerColor: white
无论如何,X 窗口的根窗口颜色不属于 Emacs 配置,我在 ~/.xinitrc 文件中这样设置23:
xsetroot -solid Navy -fg white &