在doom-emacs下配置snails,主题样式怎么都不对。 请问如何设置才能与doom-theme保持一致呢?
~/.doom.d/config.el配置代码如下
(def-package! snails
:after (doom-themes)
:load-path "~/.emacs.d/elisp/snails/"
:config
(require 'snails)
(defun snails3()
(interactive)
(snails '(snails-backend-awesome-tab-group
snails-backend-buffer
snails-backend-recentf)))
(add-hook 'snails-mode-hook (lambda () (evil-emacs-state)))
(global-set-key (kbd "C-S-p") 'snails3))
效果如图:
设置snails相关的face。
snails-candiate-content-face
snails-content-buffer-face
snails-copy-candidate-face
snails-header-index-face
snails-header-line-face
snails-input-buffer-face
snails-select-line-face
比如
(set-face-attribute 'snails-candiate-content-face nil :inherit 'default :background nil)
好巧,我也刚在群里问类似的问题。我摸索到的方法是这么调用:
(map! (:leader
(:gnv "os" (lambda ()
(interactive)
(snails-init-face-with-theme)
(snails)))
(:gnv "oS" (lambda ()
(interactive)
(snails-init-face-with-theme)
(snails-search-point)))))
我把这段配置放在~/.doom.d/init.el和 ~/.doom.d/config.el中都不生效。
这是我config.el里这段的全部配置,没问题啊
我直接加一条hook配置。
(add-hook 'snails-mode-hook (lambda () (snails-init-face-with-theme)))
嗯嗯,我是直接一开始就想着在调用那里加了。你这个好
doom-emacs不知道是怎么组织配置的。尝试过如下配置,不管用
(after! doom-thems
(snails-init-face-with-theme))
(def-package-hook! doom-themes
:post-config
(snails-init-face-with-theme)
t)
无奈只能用
(add-hook 'snails-mode-hook (lambda () (snails-init-face-with-theme)))
(add-hook 'snails-mode-hook (lambda ()
(snails-init-face-with-theme)
(evil-emacs-state)))
正好,也要在hook里加emacs-state,一起解决了。
Snails 会在插件加载的时候,根据主题初始化face一次。
但是这时候,用户的主题可能在snails加载后再加载。
Call `snails-init-face-with-theme' when user execute snails command. · manateelazycat/snails@d5d543f · GitHub 补丁会再每次启动 snails 命令的时候都重新根据主题计算一次face
更新到最新版就可以了。
1 个赞
更新最新版即可,不建议自定义这些face,完全没有必要,开箱即用。