我想在Windows中安装Emacs的Evil模式,但是我找不到任何相关文档。 Evil模式是否适用于Windows?如果是的话,如何安装?
If you don't have a .emacs
or init.el
file yet, simply copy the supplied init.el
file into your emacs.d
directory. Emacs will automatically load evil mode when you next open the program.
(If you are running Windows, your emacs.d
directory will probably be located at C:\Users\your-user-name\AppData\Roaming\.emacs.d
.)
If you already have a .emacs
or init.el
config file, open up the github init
file and copy across the code it contains to your own config file (if you already have some of this code, or some code that does the same job, you don't have to repeat it):
(require 'package)
(add-to-list 'package-archives
'("melpa" . "http://melpa.milkbox.net/packages/") t)
;;; from purcell/emacs.d
(defun require-package (package &optional min-version no-refresh)
"Install given PACKAGE, optionally requiring MIN-VERSION.
If NO-REFRESH is non-nil, the available package lists will not be
re-downloaded in order to locate PACKAGE."
(if (package-installed-p package min-version)
t
(if (or (assoc package package-archive-contents) no-refresh)
(package-install package)
(progn
(package-refresh-contents)
(require-package package min-version t)))))
(package-initialize)
(require-package 'evil)
(setq evil-search-module 'evil-search
evil-want-C-u-scroll t
evil-want-C-w-in-emacs-state t)
(require 'evil)
(evil-mode t)
Again, just follow these steps, and emacs will automatically load evil mode when you next open the program.
load-path
。 - Dmitry