Prelude Evil
Overview
This module provides Vim emulation in Emacs via evil-mode. It bundles several useful evil extensions and sets up sensible defaults for a Vim-like experience within the Prelude environment.
Packages
The following packages are installed and configured:
- evil - the extensible vi layer for Emacs
- evil-surround - emulates vim-surround
- evil-visualstar -
search visual selection with
* - evil-numbers - increment/decrement numbers like in Vim
- goto-chg - go to
recent changes (
g-;andg-,)
Key Bindings
Normal State
| Key | Command | Description |
|---|---|---|
| C-a | evil-numbers/inc-at-pt |
Increment number at point |
| C-S-a | evil-numbers/dec-at-pt |
Decrement number at point |
| Y | prelude-yank-to-end-of-line |
Yank to end of line |
| SPC | avy-goto-word-1 |
Jump to a word using Avy |
| C-S-d | Scroll down other window | |
| C-S-u | Scroll up other window |
Visual State
| Key | Command | Description |
|---|---|---|
| > | Shift right | Shift right and restore selection |
| < | Shift left | Shift left and restore selection |
Ex Commands
| Command | Action |
|---|---|
:W |
Write all buffers |
:Tree |
Open Speedbar |
:linum |
Toggle line numbers |
:Align |
Align by regexp |
Org Mode Integration
The module includes custom evil key bindings for org-mode:
| Key | Command |
|---|---|
| gk | outline-up-heading |
| gj | outline-next-visible-heading |
| t | org-todo |
| ,c | org-cycle |
| ,e | org-export-dispatch |
| ,n / ,p | Next/previous visible heading |
| ,t | org-set-tags-command |
| ,u | outline-up-heading |
Magit Integration
HJKL navigation is added to Magit buffers (log, commit, branch manager, status).
Configuration
The default cursor styles are:
- Emacs state: red box
- Normal state: gray box
- Visual state: gray box
- Insert state: gray bar
- Motion state: gray box
The default shift width is set to 2. You can customize these in your personal config.