在 doom-modeline 下使用 nyan mode

我想在 doom-modeline 下使用 nyan mode , 我没有使用 doom emacs

(use-package doom-modeline
  :ensure t
  :init (doom-modeline-mode 1)
  :config
  (setq doom-modeline-icon (display-graphic-p)
	doom-modeline-buffer-encoding nil
	doom-modeline-enable-word-count t)
  (use-package nyan-mode
    :ensure t
    :hook (doom-modeline-mode . nyan-mode)
    :config
    (setq nyan-animate-nyancat t
	  nyan-wavy-trail t)))

但是nyan cat 没有出现,但是我 M-x doom-modeline-mode 关掉 doom-modeline-mode 后,nyan cat 出现了而且工作的很好,我尝试搜索了一些可能的方案,并不能工作。

我该怎么做

把这个包的配置拿出来,不要包在 doom-modeline 的配置里面。

试过了,没有用,效果是一样的

(use-package doom-modeline
  :ensure nil
  ;; :init (doom-modeline-mode 1)
  :hook (after-init . doom-modeline-mode)
  :custom
  ;; Don't compact font caches during GC. Windows Laggy Issue
  (inhibit-compacting-font-caches t)
  :config
  (setq doom-modeline-buffer-file-name-style 'relative-to-project)
  (setq doom-modeline-height 18)
  (setq doom-modeline-highlight-modified-buffer-name t)
  (setq doom-modeline-icon (display-graphic-p))
  (setq doom-modeline-major-mode-color-icon t)
  (setq doom-modeline-minor-modes nil)
  (setq doom-modeline-project-detection 'auto) ;auto/project
  (setq doom-modeline-window-width-limit 85)
  (setq find-file-visit-truename t)
  )

(use-package nyan-mode
  :ensure nil
  :hook (doom-modeline-mode . nyan-mode)
  :config
  (setq nyan-animate-nyancat t
        nyan-wavy-trail t)
)

照我的配置改。

use-package 中不理解的用法不要用,本来它就是语法糖,再一层套一层,自己就把自己搞晕了。

1 个赞

这个有用

(use-package doom-modeline
  :ensure t
  :hook (after-init . doom-modeline-mode)
  :config
  (setq doom-modeline-icon (display-graphic-p)
	doom-modeline-buffer-encoding nil)
  (use-package nyan-mode
    :ensure t
    :hook (doom-modeline-mode . nyan-mode)
    :config
    (setq nyan-animate-nyancat t
	  nyan-wavy-trail t)))

貌似这两个 hook 很重要,上边一个用init 替换 nyan就不会出现,下边一个用别的换nyan-mode 的 animate 和trail就不能正常工作。

不清楚为什么

另外,emacs宽度要够,不然在 doom-moodline下,nyan不会出现。