Open-source project
emacs-evil/evil avatar
emacs-evil/evil

evil: The Extensible Vi Layer for Emacs

The extensible vi layer for Emacs.

3,857 stars308 forksEmacs LispGPL-3.0

At a glance

What is it?
evil brings Vim's modal editing model into Emacs as a first-class layer, not an afterthought emulation. It reproduces Vim's normal, insert, visual, and operator states, allows extensions to add new states, and integrates with Emacs's existing package ecosystem rather than replacing it.
Who is it for?
evil is the right choice for Vim users who want Emacs's extensibility, particularly its Lisp environment and the broader package ecosystem, without giving up modal editing. It is not a replacement for Vim or Neovim: anyone satisfied with Vim should stay in Vim.
Can I use it commercially?
Yes, with conditions. GPL-3.0 is a copyleft licence: if you distribute software that includes it, you must release that software's source code under the same licence. Running it internally without distributing it does not trigger that obligation.
Is it still maintained?
Yes. The repository last received commits 65 days ago.
What is it written in?
Mainly Emacs Lisp, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on September 30, 2026, and from our analysis. They are not legal advice.

Editorial analysis

What evil Is and Why It Exists

Emacs and Vim have historically represented two different philosophies of text editing. Vim uses modal editing: different modes (normal, insert, visual) change what keys do, keeping fingers on the home row and allowing complex operations through short key sequences. Emacs uses a modifier-key model where commands are combinations of Control and Meta with other keys.

Evil exists because some developers want the Emacs ecosystem (a programmable editor with Lisp, a rich package library, and tight integration with language tooling) but find modal editing faster and more comfortable than modifier-key combinations. The README describes evil as an extensible vi layer, with the word extensible doing real work: evil is designed so that other packages can add new states, new keybindings, and new operator behaviors on top of it.

The README also points to the EmacsWiki page on evil and an online documentation site. The package is available on MELPA (the standard community Emacs package archive) and on the NonGNU ELPA archive maintained by the Emacs project itself. There is also a stable MELPA channel for teams that want pinned releases.

Installing evil via package.el

The README gives a quickstart that installs evil through Emacs's built-in `package.el`. Add the following to your Emacs init file to register MELPA, download evil, and activate it globally:

elisp
;; Set up package.el to work with MELPA
(require 'package)
(add-to-list 'package-archives
             '("melpa" . "https://melpa.org/packages/"))
(package-initialize)
(package-refresh-contents)

;; Download Evil
(unless (package-installed-p 'evil)
  (package-install 'evil))

;; Enable Evil
(require 'evil)
(evil-mode 1)

The `(evil-mode 1)` call activates the vi layer globally across all buffers. After this, Emacs starts in normal mode in every buffer and you use `i` to enter insert mode and `ESC` or a configured key to return to normal mode.

Evil requires Emacs 24.1 or later. The README documents three dependencies beyond Emacs itself. For the `C-r` redo operation, evil requires one of: `undo-redo` from Emacs 28 (built in), the `undo-tree` package from GNU ELPA, or the `undo-fu` package from MELPA or NonGNU ELPA. For the `g;` and `g,` motions and the last-change register `.`, evil requires the `goto-chg.el` package. Emacs versions 24.1 and 24.2 also need `cl-lib` from ELPA.

What evil Emulates from Vim

The README says evil emulates the main features of Vim and provides facilities for writing custom extensions. The feature set covers Vim's core editing model: normal, insert, visual, operator-pending, and replace states, as well as the ex command-line (`:`). The Makefile shows that evil is organized into modules: `evil-states.el` defines the state system, `evil-commands.el` holds command implementations, `evil-maps.el` handles keybindings, `evil-search.el` covers search, `evil-macros.el` handles macro recording and playback, `evil-repeat.el` implements the dot operator, `evil-jumps.el` manages the jump list, and `evil-ex.el` covers ex commands.

The `evil-integration.el` module handles compatibility with Emacs's built-in modes and packages. This is where evil maps its keybindings into Emacs buffers like `dired`, `help`, and others that have their own key conventions.

Because evil is implemented as an Emacs Lisp layer, it can coexist with any other Emacs package. You can use evil's keybindings in an org-mode buffer, a Magit buffer, or a company-mode completion popup. The `evil-collection` package, listed in the related searches, extends this integration to a larger set of third-party packages.

Building and Testing evil

The repository uses `eask` (the Emacs project's build tool) managed through a Makefile. To byte-compile the package:

bash
make

To run the test suite:

bash
make test

To run only tests matching a specific tag or name, pass the TAG variable:

bash
make test TAG=repeat

This runs only tests related to the repeat system. The `tests` target byte-compiles first and then runs tests, which is the stricter path. The `emacs` target loads evil in a fresh Emacs instance and runs tests interactively, while the `term` target does the same in a terminal Emacs. These targets are primarily for contributors who want to verify changes before submitting a pull request.

How evil Compares to Viper Mode

Emacs ships a built-in vi emulation called Viper mode. Viper is older, less complete as a Vim emulation, and not designed to be extended by other packages. evil was built specifically because Viper did not satisfy users who wanted a full Vim experience inside Emacs.

The practical difference is that evil has a large package ecosystem built on top of it. evil-collection adds evil keybindings for hundreds of third-party packages. Doom Emacs and Spacemacs are full Emacs distributions that use evil as their editing foundation. The extensions and distributions mean that choosing evil gives you a large community of configurations to draw from.

Vim and Neovim remain the right choice for anyone who wants the native Vim experience. evil's value is specifically for developers who want to work in Emacs for its Lisp environment, org-mode, Magit, LSP integrations, or other packages, while keeping a Vim-like editing model.

Maintenance and License

evil is licensed under the GPL-3.0. The repository is hosted under the `emacs-evil` organization on GitHub. The last push was on 2026-07-28. The documentation is hosted at `evil.readthedocs.io` and is available in HTML, PDF, and EPUB formats. The project has a mailing list at `gmane.emacs.vim-emulation` and an IRC channel at `irc.libera.chat #evil-mode`. Contributing guidelines are in `CONTRIBUTING.md` in the repository root.

Editorial conclusion

evil is the right choice for Vim users who want Emacs's extensibility, particularly its Lisp environment and the broader package ecosystem, without giving up modal editing. It is not a replacement for Vim or Neovim: anyone satisfied with Vim should stay in Vim. Doom Emacs and Spacemacs both build on evil, so adopting one of those distributions is a lower-effort path than configuring evil from scratch. Before setting it up, verify that your preferred undo backend (undo-redo from Emacs 28, undo-tree, or undo-fu) is installed, as evil's C-r behavior depends on it.

Frequently asked questions

How do I use Evil mode in Emacs?

Add MELPA to your package archives, install evil with `(package-install 'evil)`, and add `(require 'evil)` followed by `(evil-mode 1)` to your init file. After restarting Emacs, all buffers will start in normal mode; press `i` to enter insert mode.

What undo package does evil require for C-r to work?

evil requires one of three undo backends for the C-r redo operation: the built-in `undo-redo` available since Emacs 28, the `undo-tree` package from GNU ELPA, or the `undo-fu` package from MELPA. Without one of these installed, C-r will not function correctly.

What is the difference between evil and Viper mode?

Viper is a built-in Emacs vi emulation that has been part of Emacs for a long time. evil is a more complete Vim emulation designed to be extended by other packages. The evil-collection package and distributions like Doom Emacs are built on evil, not Viper.

Official sources

  1. emacs-evil/evil on GitHub
  2. Issues
  3. License: GPL-3.0
  4. README
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/emacs-evil-evil.svg)](https://hysenlabs.com/projects/emacs-evil-evil)