配置文件位置
配置文件放在 .emacs.d/init.el
去除开始页面
在 init.el 中增加
;; don't show startup message
(setq inhibit-startup-message t)
elpa package
(require 'package)
(setq package-enable-at-startup nil)
(add-to-list 'package-archives
'("melpa" . "https://melpa.org/packages/"))
(package-initialize)
重新打开 emacs 后,m-x list-packages 可以查看到内置的包。m-x packages-refresh-content 可以链接网络刷新这些包。
安装 use-package 用于简化与 package-manager 的沟通。
https://github.com/jwiegley/use-package
;; install use-package
(unless (package-installed-p 'use-package)
(package-refresh-contents)
(package-install 'use-package))
然后在上面这个末尾输入 c-x c-e 运行这条语句,按照 use-package。
安装 try,用于测试包,而不安装包,https://github.com/larstvei/Try
;; try
(use-package try
:ensure t)
然后在上面这个末尾输入 c-x c-e 运行这条语句,然后就可以 m-x try 来安装相应的包,比如说 2048-game,按照好之后,就可以 m-x 2048-game 来运行这个包。但是当重启 emacs 的时候,就无法再次运行上次的 2048-game 了, try 就是为了尝试这个作用。
安装 which-key,当按了 c-x 之类的按键之后,等待 1秒钟,下面就会有可用的提示。 https://github.com/justbur/emacs-which-key
;; which-key https://github.com/justbur/emacs-which-key
(use-package which-key
:ensure t
:config (which-key-mode))
别忘了添加之后输入 c-x c-e 来安装好这个包,然后输入 c-x 等待1秒,就可以看到相应的提示内容了。
参考:
Using Emacs - Setting up the Package Manager
https://cestlaz.github.io/posts/using-emacs-1-setup/