Emacs主题配色错误。

4
我安装了Emacs并想要使用atom.io主题,就像这里所示: GitHub

颜色应该是: Theme Preview

下面是我当前的颜色截图: My Emacs

我也安装了atom.io, 示例的预览效果是正确的,这是我的atom.io截图: my atom.io shot

最后,这是我的.emacs配置文件:

(require 'package)
(add-to-list 'package-archives '("melpa" . "http://melpa.milkbox.net/packages/"))
(package-initialize)
(load-theme 'atom-one-dark t)
(require 'powerline)
(powerline-default-theme)
(custom-set-variables
 ;; custom-set-variables was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 '(custom-safe-themes
   (quote
    ("90d329edc17c6f4e43dbc67709067ccd6c0a3caa355f305de2041755986548f2" "b9c57187960682d4$
 '(desktop-save-mode 1)
 '(global-hl-line-mode 1)
 '(global-linum-mode 1))
(custom-set-faces
 ;; custom-set-faces was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 )

为什么我的Emacs颜色不同?这可能是因为我的颜色设置错误吗?或者其他原因导致的?


你在emacs的初始化文件中设置了它吗? - xuhdev
你是在作为一个图形应用程序运行Emacs,还是在像Konsole这样的终端内部运行它? - Chris
图形应用程序 - Martin Fischer
你能运行 M-x customize-themes 命令并查看正在使用的主题吗? - xuhdev
只有 atom-one-dark 被选中 - Martin Fischer
我的Emacs/操作系统出了什么问题? - Martin Fischer
1个回答

1
我遇到了同样的问题,似乎这是Mac用户的常见问题。我在类似主题的GitHub页面的问题部分dracula上找到了一些帮助。我按照apierz的修复方法来纠正我的终端上的颜色。
通过比较dracula主题代码和原子单一主题,你可以看到两个主题都使用十六进制颜色#282*的背景。基本上我们需要将背景的十六进制颜色更改为更兼容的颜色。
在你的atom-one-theme.el文件中注释掉这行代码,并添加另一个值为nil的颜色值。
;;; Code:

(deftheme atom-one-dark
  "Atom One Dark - An Emacs port of the Atom One Dark theme from Atom.io.")
(defvar atom-one-dark-colors-alist
  '(("atom-one-dark-accent"   . "#528BFF")
    ("atom-one-dark-fg"       . "#ABB2BF")
;;    ("atom-one-dark-bg"       . "#282C34")
    ("atom-one-dark-bg"       . nil

这将使您的背景色与您的终端窗口相同。由于我的背景颜色类似于#282C34,因此我的外观看起来很像Atom One Dark主题。 或者,您可以将背景颜色设置为#000000(黑色),但我认为它看起来不太吸引人。 向apierz致敬,他最初在GitHub上发布了修复程序!

what_it_should_look_like.png


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接