Convert Figma logo to code with AI

emacs-evil logoevil

The extensible vi layer for Emacs.

3,331
281
3,331
275

Top Related Projects

19,200

An Emacs framework for the stubborn martian hacker

23,638

A community-driven Emacs distribution - The best editor is neither Emacs nor Vim, it's Emacs *and* Vim!

6,839

An Emacs configuration bundle with batteries included

5,100

Prelude is an enhanced Emacs 25.1+ distribution that should make your experience with Emacs both more pleasant and more powerful.

19,200

An Emacs framework for the stubborn martian hacker

Quick Overview

Evil is an extensible vi layer for Emacs. It emulates the main features of Vim, providing a modal editing experience within Emacs, while also allowing users to leverage Emacs' powerful extensibility and ecosystem.

Pros

  • Brings Vim's efficient editing model to Emacs
  • Highly customizable and extensible
  • Integrates well with existing Emacs packages
  • Large and active community for support and development

Cons

  • Learning curve for Emacs users not familiar with Vim
  • Potential conflicts with some Emacs keybindings
  • May require additional configuration for optimal use
  • Some Vim plugins or features may not be fully supported

Code Examples

  1. Basic Evil mode activation:
(require 'evil)
(evil-mode 1)

This code enables Evil mode globally in Emacs.

  1. Customizing Evil key bindings:
(evil-define-key 'normal 'global
  (kbd "C-s") 'save-buffer
  (kbd "C-f") 'find-file)

This example remaps Ctrl+S to save the buffer and Ctrl+F to find a file in normal mode.

  1. Creating a custom Evil operator:
(evil-define-operator evil-upcase (beg end type)
  "Convert text to uppercase."
  :move-point nil
  :repeat nil
  (upcase-region beg end))

(define-key evil-normal-state-map "gu" 'evil-upcase)

This code defines a new Evil operator that converts text to uppercase and binds it to "gu" in normal mode.

Getting Started

To get started with Evil, follow these steps:

  1. Install Evil via MELPA or manually:

    (require 'package)
    (add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/"))
    (package-initialize)
    (package-install 'evil)
    
  2. Add the following to your Emacs configuration file:

    (require 'evil)
    (evil-mode 1)
    
  3. Restart Emacs or evaluate the configuration.

  4. Start using Vim keybindings in Emacs! Use :q to quit, i to enter insert mode, and Esc to return to normal mode.

Competitor Comparisons

19,200

An Emacs framework for the stubborn martian hacker

Pros of Doomemacs

  • Comprehensive configuration framework with curated packages and optimizations
  • Faster startup time and improved performance out of the box
  • Modular design allowing easy customization and extension

Cons of Doomemacs

  • Steeper learning curve for users new to Emacs or custom configurations
  • Potential conflicts with existing Emacs setups or personal configurations
  • Larger codebase and more complex structure compared to Evil

Code Comparison

Evil (Vim emulation layer):

(require 'evil)
(evil-mode 1)
(evil-set-initial-state 'mode 'state)

Doomemacs (Configuration example):

(doom! :input
       :completion
       :ui
       :editor
       (evil +everywhere)
       :emacs
       :term
       :tools
       :lang
       :config
       literate)

Evil focuses solely on providing Vim-like editing capabilities, while Doomemacs offers a complete Emacs distribution with Evil integration and many additional features. Evil is more lightweight and easier to integrate into existing Emacs setups, whereas Doomemacs provides a pre-configured environment with optimized performance and a curated selection of packages.

23,638

A community-driven Emacs distribution - The best editor is neither Emacs nor Vim, it's Emacs *and* Vim!

Pros of Spacemacs

  • Comprehensive configuration: Spacemacs provides a pre-configured Emacs setup with many popular packages and sensible defaults
  • Mnemonic keybindings: Uses a consistent, easy-to-remember keybinding system based on mnemonic prefixes
  • Modular architecture: Allows for easy customization and extension through "layers"

Cons of Spacemacs

  • Steep learning curve: The extensive features and customizations can be overwhelming for new users
  • Slower startup time: Due to its large codebase and many included packages
  • Potential conflicts: May clash with existing Emacs configurations or preferences

Code Comparison

Evil (minimal configuration):

(require 'evil)
(evil-mode 1)

Spacemacs (example layer configuration):

(setq-default dotspacemacs-configuration-layers
  '(
    (auto-completion :variables
                     auto-completion-return-key-behavior 'complete
                     auto-completion-tab-key-behavior 'cycle)
    better-defaults
    emacs-lisp
    git
    markdown
    org
    (shell :variables shell-default-height 30 shell-default-position 'bottom)
    spell-checking
    syntax-checking
    version-control
  ))

Evil focuses solely on providing Vim emulation within Emacs, while Spacemacs offers a complete Emacs distribution with Evil mode integrated, along with many other features and optimizations.

6,839

An Emacs configuration bundle with batteries included

Pros of emacs.d

  • Comprehensive Emacs configuration with a wide range of features and packages
  • Regular updates and maintenance by an experienced Emacs user
  • Includes configurations for multiple programming languages and development tools

Cons of emacs.d

  • Steeper learning curve due to its extensive customizations
  • May conflict with existing user configurations or preferences
  • Potentially slower startup time due to the large number of packages

Code Comparison

emacs.d:

(require-package 'projectile)
(add-hook 'after-init-hook 'projectile-mode)
(setq-default projectile-mode-line-prefix " Proj")
(setq projectile-sort-order 'recently-active)

evil:

(require 'evil)
(evil-mode 1)
(evil-set-initial-state 'term-mode 'emacs)
(evil-set-initial-state 'calculator-mode 'emacs)

Summary

emacs.d is a comprehensive Emacs configuration that provides a wide range of features and packages for various programming languages and development tools. It offers regular updates and maintenance but may have a steeper learning curve and potential conflicts with existing configurations.

Evil, on the other hand, is focused on providing Vim-like editing capabilities within Emacs. It's more specialized and may be easier to integrate into existing Emacs setups without significant conflicts.

The choice between the two depends on whether you prefer a full-featured Emacs configuration (emacs.d) or want to add Vim-like editing to your existing Emacs setup (Evil).

5,100

Prelude is an enhanced Emacs 25.1+ distribution that should make your experience with Emacs both more pleasant and more powerful.

Pros of Prelude

  • Comprehensive Emacs configuration framework, offering a complete out-of-the-box setup
  • Includes a curated set of popular packages and sensible defaults for enhanced productivity
  • Modular design allows for easy customization and extension

Cons of Prelude

  • Steeper learning curve for users accustomed to traditional Emacs configurations
  • May include unnecessary features or packages for some users' workflows
  • Potential conflicts with existing user configurations or preferences

Code Comparison

Evil (Vim emulation):

(require 'evil)
(evil-mode 1)
(evil-set-initial-state 'term-mode 'emacs)

Prelude (Enhanced default configuration):

(require 'prelude-core)
(require 'prelude-editor)
(require 'prelude-global-keybindings)

Summary

Evil focuses on bringing Vim-like editing capabilities to Emacs, while Prelude provides a comprehensive Emacs configuration framework. Evil is ideal for Vim users transitioning to Emacs or those who prefer Vim keybindings. Prelude, on the other hand, offers a more opinionated and feature-rich setup for Emacs, catering to users who want a pre-configured environment with modern defaults and popular packages included.

19,200

An Emacs framework for the stubborn martian hacker

Pros of Doomemacs

  • Comprehensive configuration framework with curated packages and optimizations
  • Faster startup time and improved performance out of the box
  • Modular design allowing easy customization and extension

Cons of Doomemacs

  • Steeper learning curve for users new to Emacs or custom configurations
  • Potential conflicts with existing Emacs setups or personal configurations
  • Larger codebase and more complex structure compared to Evil

Code Comparison

Evil (Vim emulation layer):

(require 'evil)
(evil-mode 1)
(evil-set-initial-state 'mode 'state)

Doomemacs (Configuration example):

(doom! :input
       :completion
       :ui
       :editor
       (evil +everywhere)
       :emacs
       :term
       :tools
       :lang
       :config
       literate)

Evil focuses solely on providing Vim-like editing capabilities, while Doomemacs offers a complete Emacs distribution with Evil integration and many additional features. Evil is more lightweight and easier to integrate into existing Emacs setups, whereas Doomemacs provides a pre-configured environment with optimized performance and a curated selection of packages.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

An extensible vi layer for Emacs

Build status MELPA MELPA Stable NonGNU ELPA Documentation Status License: GPL v3

Evil is an extensible vi layer for Emacs. It emulates the main features of Vim, and provides facilities for writing custom extensions. Also see our page on EmacsWiki.

Installation

See the official documentation for installation instructions. We recommend using package.el.

As a quickstart, you can add the following code to your Emacs init file.

;; 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)

Dependencies

  • Evil requires Emacs 24.1 or later.

  • Evil requires any of the following for C-r:

    • undo-redo from Emacs 28
    • The undo-tree package (available via GNU ELPA)
    • The undo-fu package (available via MELPA and NonGNU ELPA)
  • For the motions g; g, and for the last-change-register ., Evil requires the goto-chg.el package (available via MELPA and NonGNU ELPA), which provides the functions goto-last-change and goto-last-change-reverse.

  • For Emacs 24.1 and 24.2 Evil also requires cl-lib.

Documentation

The latest version of the documentation is readable online here. It is also available as PDF and as EPUB.

Mailing list

Evil is discussed at the gmane.emacs.vim-emulation mailing list.

IRC

Visit us on irc.libera.chat #evil-mode.

Contribution

See CONTRIBUTING.md for guidelines for issues and pull requests.