使用Spacemacs国内镜像

最近开始使用emacs写一些clojure的代码,但是不挂梯子的话,源的更新确实不快,因此决定到网上搜索一下怎么配置国内镜像,不过搜索结果大概都是下面这个样子:

# 基于emacs26
cd ~
git clone https://github.com/syl20bnr/spacemacs .emacs.d
修改
vim .emacs.d/core/templates/.spacemacs.template
(defun dotspacemacs/user-init ()
  "Initialization function for user code.
It is called immediately after `dotspacemacs/init', before layer configuration
executes.
 This function is mostly useful for variables that need to be set
before packages are loaded. If you are unsure, you should try in setting them in
`dotspacemacs/user-config' first."
(setq configuration-layer--elpa-archives
    '(("melpa-cn" . "http://mirrors.tuna.tsinghua.edu.cn/elpa/melpa/")
      ("org-cn"   . "http://mirrors.tuna.tsinghua.edu.cn/elpa/org/")
      ("gnu-cn"   . "http://mirrors.tuna.tsinghua.edu.cn/elpa/gnu/")))
  )

其实也没什么问题,原文内也都说明了是在第一次初始化之前修改这个模板文件。

不过对于已经配置过的,还是直接修改按照模板生成的配置文件 ~/.spacemacs 即可:

;; 修改的位置基本不变,修改 ~/.spacemacs 文件
(defun dotspacemacs/user-init ()
  "Initialization function for user code.
It is called immediately after `dotspacemacs/init', before layer configuration
executes.
 This function is mostly useful for variables that need to be set
before packages are loaded. If you are unsure, you should try in setting them in
`dotspacemacs/user-config' first."
(setq configuration-layer--elpa-archives
  '(("melpa-cn" . "http://elpa.emacs-china.org/melpa/")
    ("org-cn"   . "http://elpa.emacs-china.org/org/")
    ("gnu-cn"   . "http://elpa.emacs-china.org/gnu/")))
  )

补充说一句

我看的blog里面很多提到了运行 emacs -nw 可以提升打开速度,但是这个是在linux前提下,是以no window模式打开的,windows里面不要用这个参数,无法打开应用窗口,而且会让系统变得莫名卡顿(win10下亲测)!