emacs安装与配置

第一步安装emacs

 yay -S emacs

配置Centaur Emacs

https://github.com/seagle0128/.emacs.d

mv ~/.emacs.d ~/.emacs.d.bak
git clone --depth 1 https://github.com/seagle0128/.emacs.d.git ~/.emacs.d

emacs配置文件有两个位置:~/.emacs~/.emacs.d/init.el,我们使用后者

HOME因为Emacs的所有文件都整齐地包含在单个目录中,所以它使目录整洁。出于同样的原因,所有现代Emacs软件包都将其缓存,历史记录等写入~/.emacs.d/。
它使版本控制更加容易,尤其是如果您将init.el拆分为中的不同文件时,尤其如此~/.emacs.d。您可以init.el像提交其他文件一样进行提交,并且git clone /my/emacs/config.git ~/.emacs.d在新系统上,您可以进行所有Emacs配置,而无需将文件链接到$HOME。

rm ~/.emacs  
ln -s ~/.emacs.d/init.el ~/.emacs  

重新打开emacs,会自动加载插件

GitHub的raw.githubusercontent.com无法链接

hosts文件添加 以下内容并保存即可恢复
199.232.68.133 raw.githubusercontent.com

配置Emacs Application Framework (EAF)

https://github.com/manateelazycat/emacs-application-framework/blob/master/README.zh-CN.md

  1. 安装EAF依赖,对于每个依赖的解释可以在依赖列表找到。
yay -S python-pyqt5 python-pyqt5-sip python-pyqtwebengine python-qrcode python-feedparser python-dbus python-pyinotify python-markdown nodejs aria2 libreoffice python-pymupdf python-grip filebrowser-bin
  1. 下载这个仓库.一般放在.emacs.d/site-lisp/
git clone https://github.com/manateelazycat/emacs-application-framework.git --depth=1
  1. 把EAF加入Emacs的 load-path,然后在 init.el 中写入:
(require 'eaf)

如果你使用use-package,下面有一个简单的配置文件供你参考:


(use-package eaf
  :load-path "~/.emacs.d/site-lisp/emacs-application-framework" ; Set to "/usr/share/emacs/site-lisp/eaf" if installed from AUR
  :custom
  (eaf-find-alternate-file-in-dired t)
  :config
  (eaf-bind-key scroll_up "C-n" eaf-pdf-viewer-keybinding)
  (eaf-bind-key scroll_down "C-p" eaf-pdf-viewer-keybinding)
  (eaf-bind-key take_photo "p" eaf-camera-keybinding))

猜你喜欢

转载自blog.csdn.net/qq_33831360/article/details/107732230