搞了个 Emacs 配色

直接用 customize-theme 生成的。

(deftheme nightmare
  "Created 2018-02-22.")

(custom-theme-set-faces
 'nightmare
 '(default ((t (:inherit nil :stipple nil :background "#1e2327" :foreground "#c4c4c4" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :height 130 :width normal :foundry "nil" :family "SF Mono"))))
 '(cursor ((t (:background "#7e96b3"))))
 '(fixed-pitch ((t (:family "Monospace"))))
 '(variable-pitch ((((type w32)) (:foundry "outline" :family "Arial")) (t (:family "Sans Serif"))))
 '(escape-glyph ((t (:foreground "#48bee5"))))
 '(minibuffer-prompt ((t (:inherit bold :foreground "#145feb"))))
 '(highlight ((t (:background "#3e3b46" :foreground "#b2b2b2"))))
 '(region ((t (:background "#424242"))))
 '(shadow ((t (:foreground "#686868"))))
 '(secondary-selection ((t (:background "#100a14"))))
 '(trailing-whitespace ((t (:background "#ff2c56"))))
 '(font-lock-builtin-face ((t (:foreground "#008cee"))))
 '(font-lock-comment-delimiter-face ((t (:inherit font-lock-comment-face))))
 '(font-lock-comment-face ((t (:background "#292e34" :foreground "#2aa1ae" :slant normal))))
 '(font-lock-constant-face ((t (:foreground "#a45bad"))))
 '(font-lock-doc-face ((t (:foreground "#48bee5"))))
 '(font-lock-function-name-face ((t (:inherit bold :foreground "#c856c5"))))
 '(font-lock-keyword-face ((t (:inherit bold :foreground "#008cee"))))
 '(font-lock-negation-char-face ((t (:foreground "#a45bad"))))
 '(font-lock-preprocessor-face ((t (:foreground "#bc6ec5"))))
 '(font-lock-regexp-grouping-backslash ((t (:inherit (bold)))))
 '(font-lock-regexp-grouping-construct ((t (:inherit (bold)))))
 '(font-lock-string-face ((t (:foreground "#41cc45"))))
 '(font-lock-type-face ((t (:inherit bold :foreground "#e80a32"))))
 '(font-lock-variable-name-face ((t (:foreground "#7590db"))))
 '(font-lock-warning-face ((t (:background "#e80a32" :foreground "#e67800"))))
 '(button ((t (:inherit (link)))))
 '(link ((t (:foreground "#48bee5" :underline t))))
 '(link-visited ((t (:foreground "#c56ec3" :underline t))))
 '(fringe ((t (:background "#0c0c0c" :foreground "#c8c8c8"))))
 '(header-line ((t (:background "#0a0814"))))
 '(tooltip ((t (:weight normal :slant normal :underline nil :foreground "#b2b2b2" :background "#5e5079"))))
 '(mode-line ((t (:box (:line-width 1 :color "#5d4d7a" :style nil) :foreground "#b2b2b2" :background "#222226"))))
 '(mode-line-buffer-id ((t (:foreground "#bc6ec5" :inherit (bold)))))
 '(mode-line-emphasis ((t (:weight bold))))
 '(mode-line-highlight ((((class color) (min-colors 88)) (:box (:line-width 2 :color "grey40" :style released-button))) (t (:inherit (highlight)))))
 '(mode-line-inactive ((t (:box (:line-width 1 :color "#5d4d7a" :style nil) :foreground "#b2b2b2" :background "#292b2e"))))
 '(isearch ((t (:background "#86dc2f" :foreground "#292b2e"))))
 '(isearch-fail ((((class color) (min-colors 88) (background light)) (:background "RosyBrown1")) (((class color) (min-colors 88) (background dark)) (:background "red4")) (((class color) (min-colors 16)) (:background "red")) (((class color) (min-colors 8)) (:background "red")) (((class color grayscale)) (:foreground "grey")) (t (:inverse-video t))))
 '(lazy-highlight ((t (:weight normal :background "#29422d"))))
 '(match ((t (:foreground "#86dc2f" :background "#444155"))))
 '(next-error ((t (:inherit (region)))))
 '(query-replace ((t (:inherit (isearch))))))

(provide-theme 'nightmare)
1 个赞

正好问你个问题,emacs里怎么得到目前正在使用的主题?


谢谢这么多人回我,我之后用 @Ldbeth 的方法advice了load-theme

默认没有这个功能。因为 Emacs 里面多个 theme 是可以叠加的,切换主题只是把新主题的设置调用一遍,旧主题还是会留下一些没有被覆盖的项目。但你可以 advice load-theme 之类的让它在更换主题的时候设置个变量

1 个赞

坐等 进 melpa

M-x disable-theme 的时候会列出load的主题,看一下它的实现应该就有你要的答案

1 个赞

M-x customize-themes 打勾的就是

配色很舒服,就我个人审美而言,再略微暗一点就更好了~

正文字体吗?还是颜色太艳了?

因为我基本只用一个主题,所以喜欢对比度高一点的。

有两个办法:

  1. M-x disable-theme
  2. 查看 custom-enabled-themes

高亮的fgcolor,我比较偏爱oceanic系的配色