如何在spacemacs中通过github添加package?

我用的是子龙山人的配置,按照子龙山人的视频第十三集里的方法在zilongshanren 的layer中添加package,尝试了两种方法,从melpa及github上安装均没成功,不知道问题出在哪里?个人觉得emacs的优点是强大的扩展性,但在spacemacs中却常常不知道该如何去使用外来的package,比如想使用lazycat的英文补全助手,虽然这个问题我最终算是解决了,但还是对spacemacs中使用package一团雾水

比如以下代码,我把blog-admin注释去掉后总是报错是怎么回事? (defconst zilongshanren-org-packages '( (org :location built-in) ;; org-mac-link org-pomodoro deft sound-wav (blog-admin :location (recipe :fetcher github :repo “codefalling/blog-admin”)) ;; org-tree-slide (elpa-mirror:location (recipe :fetcher github :repo “redguardtoo/elpa-mirror”)) ;; ox-reveal ;; worf ;; org-download ;; plain-org-wiki ) 另外我在其中加入elpa-mirror后似乎也没有安装上这个package

https://www.jianshu.com/p/ab5c2658ee2f

感谢指教,你的总结很好,不过我这边需要的不是这几种形式,我还是先再折腾一下

单独 package 就在 dotspacemacs-additional-packages 里加,如果多的话可以可以自己封装个 layer,可以去看看 FAQ

感觉之前问题未描述清楚,重新描述,这一问题实在是折腾太久了 很多人说emacs最大的优点是可扩展性,作为一名spacemacs用户,一直以来困扰我的问题是如何给spacemacs安装package,虽然其本身可以用addtional package通过elpa安装package,但毕竟elpa上的package并不完整,有许多优秀的package是通过emacswiki或github发布的,譬如lazycat的company-english-helper发布在GitHub上面,everything.el发布在emacswiki上面,尽管spacemacs可以在layer里面通过github来安装,但我在使用用GitHub安装时总出现提示“package XXX:location not initialized in layer zilongshanren-misc, you may consider removing this package from the package list or use the :toggle keyword instead of a `when’ form”这样的错误,我不知道产生这一问题的原因是因为我写的init函数不正确还是其他原因,这一问题的确困扰我很久。我用的是子龙山人配置版的spacemacs,如果使用子龙山人的21天学习emacs的第13天里的教学例子(gulpjs :location (recipe :fetcher github :repo “zilongshanren/emacs-gulpjs”)),添加这个package却不会出现以上错误。如果是我写的init函数出了问题,请问init函数的标准写法是什么呢,我只知道模仿着写入use-package,":init",":defer t"

另外请教一下有人在spacemacs中实现过将company-english-helper安装成功的么?如果有,请教你的方法是什么?我虽然也实现了可以用,但始终感觉是野路子,不能传到github上保存,不正规

我用的是submodule,可在spacemacs中安装company-english-helper,也可以随着github更新。

submodule是什么东东?头一次听说,我网上找到的好多是git submodule,是这个吗?

关于company-english-helper在spacemacs中的实现我的方法是,将company.el、company-english-helper-data.el、company-english-helper.三个文件放在C:\Users\dbv771\AppData\Roaming.emacs.d\core\文件夹,然后在C:\Users\dbv771\AppData\Roaming.emacs.d\init.el的开始写入

(load (concat (file-name-directory load-file-name)
              "core/company.el")
      )
(load (concat (file-name-directory load-file-name)
              "core/company-english-helper-data.el")
   )
(load (concat (file-name-directory load-file-name)
              "core/company-english-helper.el")
         )

功能上虽可以实现,但毕竟是用load的方法,而且不方便网络同步,总觉得是野路子

就是 git submodule

直接在 dotspacemacs-additional-packages 中加的参考:

dotspacemacs-additional-packages '((org-protocol-capture-html :location (recipe
                                                                               :fetcher github
                                                                               :repo "alphapapa/org-protocol-capture-html")))

我记得这些东西 faq 还是哪里一搜就有吧

多谢指点,试了你的这个方法,确实可行,看来在自定义的layer里面添加package还是要比在init.el里面要复杂,不过新的问题又产生了,比如我通过github安装company-english-helper,最后又产生如下错误

Error getting PACKAGE-DESC: (file-missing Opening input file No such file or directory c:/Users/dbv771/AppData/Roaming/.emacs.d/.cache/quelpa/packages/company-english-helper-20190430.1922.tar)

不得不感慨emacs里的坑真多

Win下坑Emacs的地方本来就多……你加上Spacemacs,两个大坑踩一起了……

若不是离不开total commander,autohotkey,及不知如何在linux下安装Chrome扩展,我早就叛逃到linux了

不止怎么安装Chrome扩展?你是认真的么 :sweat_smile::sweat_smile::sweat_smile:

看样子没下下来?

同类工具 autohotkey 比 autoit3 功能差不少

Worse is Better :rofl:

我真的不知道linux在没有网络工具的情况下如何利用国内网络环境给chorome安装扩展,能够直接访问应用商店安装还是有其他途径?不知道windows下的拖拽crx插件的方法行不行,我是键盘党,使用浏览器重度依赖vimium插件,我曾用双硬盘安装过Ubuntu18,在上面尝试了spacemacs,发现在linux下emacs不仅速度很快,完全没有卡顿,而且字体非常漂亮,不像windows下字体比较难看,但我不知道如何在Ubuntu下访问外部网络,上网查了好像配置编译也比较复杂,如果不能顺利的上网,使用emacs就太不方便了。