Windows10中安装emacs最稳妥的5个步骤
千呼万唤,等到了emacs-windows版本。
PS C:\Users\gaowei> emacs --version
GNU Emacs 27.1
Copyright (C) 2020 Free Software Foundation, Inc.
GNU Emacs comes with ABSOLUTELY NO WARRANTY.
You may redistribute copies of GNU Emacs
under the terms of the GNU General Public License.
For more information about these matters, see the file named COPYING.
本文探讨安装和配置emacs最可靠的姐姐方案。
1.准备工作
配置好‘包管理’工具,比如scoop,请参阅 最有效率的工作方式?Win10上安装包管理工具scoop
2.修改环境变量
Emacs的windows版本默认动作将目录C:\Users\USERNAME\AppData\Roaming当作HOME,我们要将其修改为C:\Users\USERNAME\。
同时将doom\bin放到路径中,即Path中添加C:\Users\USERNAME\.emacs.d\bin。
变更环境变量的步骤分解请参阅 Windows10如何修改环境变量,更改Home目录?
3.安装emacs
在windows-terminal中输入下列脚本
scoop bucket add extras
scoop install git emacs ripgrep fd llvm
起身喝杯水,30分钟后再回来。
4.配置doom
打开git-bash(注意务必要在git-bash中运行以下命令)
git clone https://github.com/hlissner/doom-emacs ~/.emacs.d
~/.emacs.d/bin/doom install
5.安装All The Icons
windows上不能够直接安装all-th-icons,需要进入到doom后重新配置,运行:
M-x all-the-icons-install-fonts
跟随提示创建.fonts目录,之后手动安装到系统中。
安装过程中可能遇到dns污染的问题,报错:
在win10下报错GitHub raw.githubusercontent.com无法连接
处理方法请参阅 Win10中修改etc/hosts解决github无法接入
6.收尾总结
拿emacs在windows作为生产力工具是一场马拉松,需要大量的自定义工作。