5.5 KiB
feature/evil
Description
This holy module brings the vim experience to Emacs.
Module Flags
+everywhereEnables evilified keybinds everywhere possible, utilizing theevil-collectionplugin.
Plugins
Hacks
- When a window is split, the new window will be focused.
- The o/O keys will respect and continue commented lines (can be disabled by
setting
+evil-want-o/O-to-continue-commentstonil). - From visual mode,
*and#will search for the current selection instead of the word-at-point. - The
:g[lobal]ex command has been modified to highlight matches incrementally. - More of vim's filename modifiers are supported in ex commands (like
:p,:p:hor:t) than vanilla evil-mode offers. - A custom filename modifier is available in Doom:
:P, which expands to the project root (throws an error if not in a project).
Prerequisites
This module has no external prerequisites.
Features
Ported vim plugins
The following vim plugins have been ported to evil:
| Vim Plugin | Emacs Plugin | Keybind(s) |
|---|---|---|
| vim-commentary | evil-commentary | omap gc |
| vim-easymotion | evil-easymotion | omap gs |
| vim-seek or vim-sneak | evil-snipe | mmap s=/=S |
| vim-surround | evil-embrace and evil-surround | vmap S, omap ys |
In other modules:
- The tools/neotree & tools/treemacs modules contain a
NERDTreeequivalent. -
The editor/multiple-cursors module contains:
vim-multiedit=> evil-multieditvim-multiple-cursors=> evil-mc
Custom Text Objects
-
A list of new text objects:
- Blocks:
B(fromevil-textobj-anyblock) - Args:
a(fromevil-args) - Indentation:
i/I/J(fromevil-indent-plus)
- Blocks:
Custom Ex Commands
| Ex Command | Description |
|---|---|
:al[ign][!] REGEXP |
Align text to the first match of REGEXP. If BANG, align all matches on each line |
:mv[!] NEWPATH |
Move the current file to NEWPATH |
:cp[!] NEWPATH |
Copy the current file to NEWPATH |
:rm[!] [PATH] |
Delete the current buffer's file and buffer |
A hybrid code-folding system
This module combines vimish-fold and hideshow. The former allows arbitrary
folds and the latter allows folds on markers and indentation. Together, they
create a more consistent (and feature-complete) code-folding system.
Most vim folding keys should work, e.g. zr, zm, za, zo, etc.
Differences from vim
- Column-wise ranges in ex commands are enabled by default. i.e. the range in
:'<,'>s/a/bwill only affects the visual selection, not full lines (seeevil-ex-visual-char-range). :gwill incrementally highlight buffer matches.
Configuration
Removing evil-mode
You must do two things to remove Evil:
- Remove
:feature evilfrom~/.doom.d/init.el, - Run
bin/doom refreshto clean up lingering dependencies and refresh yuor autoloads files. - [OPTIONAL] You may want a new
doom-leader-alt-keyanddoom-localleader-alt-key. By default, these are bound toM-SPCandM-SPC m.
Ignore
doom-leader-keyanddoom-localleader-key, they don't apply to non-evil sessions.
Note that evil-specific configuration and keybinds (defined with map!) will be
ignored without evil present (and stripped out when byte-compiling).
Unfortunately, since Doom was designed by a vimmer, for vimmers, little consideration into a keybinding scheme for vanilla Emacs users.