环境准备
# 系统更新升级
sudo apt-get update && apt-get upgrade
# 安装源码编译需要的包
sudo apt-get install build-essential libncurses-dev
下载源码包
略
编译安装
cd emacs-xxx
# 安装需要的包及X窗口支持
sudo apt install autoconf make gcc texinfo libgtk-3-dev libxpm-dev libjpeg-dev libgif-dev libtiff5-dev libncurses5-dev libxml2-dev libgnutls28-dev
./autogen.sh
./configure --prefix=/xx/xx/xx
# 编译生成
make -j 2
# 安装
make install
配置 spacemacs
- 下载
# 备份原始配置
mv .emacs.d .emacs.d.bak
mv .emacs .emacs.bak
# 克隆 spacemacs,并切换到 develop 分支
git clone https://gitee.com/mirrors/spacemacs.git ~/.emacs.d
cd ~/.emacs.d && git checkout develop
- 安装
emacs --insecure
将会进入emacs后要求选择编辑方式(vim或emacs)、标准版还是精简版。建议换为国内源:
- 退出emacs,先按
Ctrl-g
再按Ctrl-x Ctrl-c
。 - 修改
.spacemacs
文件,找到defun dotspacemacs/user-init ()
函数,在函数中根据清华大学的镜像的帮助进行添加,要注意master
和develop
分支是不同的,添加后结果如下:
(defun dotspacemacs/user-init ()
"Initialization for user code:
This function is called immediately after `dotspacemacs/init', before layer
configuration.
It is mostly for variables that should be set before packages are loaded.
If you are unsure, try 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/")))
)
网友评论