为什么spacemacs启动时会自动删除package?

在安装 linum-relative package时发现该package在启动时会被自动删除,具体如下:

  1. 通过 M-x package-list-package 已成功安装linum-relative ,且能有效显示相对行号。
  2. 重启 spacemacs 会自动删除 linum-relative ,启动时显示信息如下:
    (Spacemacs) --> deleting linum-relative... [1/1] 
    
  3. dotspacemacs-additional-packages '(...)中加入 linum-relative ,重启依然自动删除 linum-relative(其他的package的自动删除问题都能通过将package放在这里解决)

请问怎么让这个 package 不被自动删除?

操作系统:win10 64位
spacemacs版本:[email protected] (spacemacs),develop分支

在additional-packages里面添加你要安装的包重启就可以了。

dotspacemacs-excluded-packages?

我已经这么做了。请看3.

我排除了 window-purpose,参考 Org Agenda 设置 Scheduled 或 Deadline 开启新 window - #12,来自 tommyjiang ,难道 window-purposelinum-relative有联系?

dotspacemacs-excluded-packages '(window-purpose)

改为

dotspacemacs-excluded-packages '()

也没有解决

我更换了package,现在使用nlinum-relative,没有出现重启自动删除的问题了,而且我挺喜欢nlinum-relative的行号显示方式的,能在当前行显示总行号,而不是像 linum-relative 显示的是0:

捕获

:astonished:

1 个赞

设置 dotspacemacs-install-packagesused-but-keep-unused 就可以了

(setq-default
   ;; Defines the behaviour of Spacemacs when installing packages.
   ;; Possible values are `used-only', `used-but-keep-unused' and `all'.
   ;; `used-only' installs only explicitly used packages and deletes any unused
   ;; packages as well as their unused dependencies. `used-but-keep-unused'
   ;; installs only the used packages but won't delete unused ones. `all'
   ;; installs *all* packages supported by Spacemacs and never uninstalls them.
   ;; (default is `used-only')
   dotspacemacs-install-packages 'used-but-keep-unused)
1 个赞