Win10下Emacs编辑器安装

目录

安装包准备

安装步骤

准备目录

解压文件

安装插件

出现错误

解决方案

成功安装


Emacs中的对齐方式多样,对于我这种强迫症患者,代码需要对齐才能好看的人,急需要一种强大的编辑器,用过很多编辑器最后发现还是Emacs比较方便。

安装包准备

安装步骤

准备目录

在D盘中新建文件夹Emacs_26.3,在文件夹Emacs_26.3中新建.emacs.d文件夹,为存放配置文件准备;

新建用户变量HOME,路径设置为刚才新建的文件夹:D:\Emacs_26.3

 

解压文件

  • 解压Emacs的安装包到D:\Emacs_26.3目录下

  • 解压spacemacs-master压缩包到.emacs.d文件夹下

安装插件

运行runemacs.exe,会自动安装常用插件,需要运行两次runemacs.exe,第一次运行会在安装目录下生成.spacemacs文件,运行后如果生成此文件立马关闭;然后修改.spacemacs中文源,为了安装插件更快。

在.spacemacs文件函数defun dotspacemacs/user-init ()里添加清华的源,进行第二次运行runemacs.exe。

(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-default
configuration-layer--elpa-archives
'(("melpa-cn" . "https://mirrors.tuna.tsinghua.edu.cn/elpa/melpa/")
("gnu-cn" . "https://mirrors.tuna.tsinghua.edu.cn/elpa/gnu/")
("org-cn" . "https://mirrors.tuna.tsinghua.edu.cn/elpa/org/"))) 
  )

出现错误

  •  is not a safe directory because it is not owned by you (owner = nil (544))
Warning (initialization): An error occurred while loading ‘d:/Emacs_26.3/.emacs.d/init.el’:

error: ‘d:/Emacs_26.3/.emacs.d/server’ is not a safe directory because it is not owned by you (owner = nil (544))

To ensure normal operation, you should investigate and remove the
cause of the error in your initialization file.  Start Emacs with
the ‘--debug-init’ option to view a complete error backtrace.
  • warning:spacemacs默认字体”Source Code Pro”不存在
  • emacs 打开有中文内容的文件会卡的解决方案
  • Emacs安装在Win10系统上打开要花很长时间

解决方案

  • 由于server文件夹是另一个用户创建的,所以我们没有权限去修改,因此在这里的解决方案就是删除重建,这样就不会出现上述错误。
  • 修改~/.spacsmacs文件, 需要把默认字体"Source Code Pro"替换掉
dotspacemacs-default-font '("Consolas"                               
:size      22                               
:weight normal                               
:width normal                               
:powerline-scale 1.1)
  • 在.spacemacs中添加     '(cua-mode t nil (cua-base))
;; Setting English Font
(set-face-attribute
‘default nil :font “Courier New-14”)
;; Setting Chinese Font
(dolist (charset ‘(kana han symbol cjk-misc bopomofo))
(set-fontset-font (frame-parameter nil ‘font)
charset
(font-spec :family “Microsoft Yahei” :size 16)))
  • Win10系统需要改为英文版本的 

成功安装

基础的功能基本上就可以使用了,欣赏以下完整的代码提示,至此Emacs安装成功,更多的插件使用方法后续。

 

 

 

 

 

 

 

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值