Modal editing (evil)
Macros ships with evil-mode: Vim-style modal editing built on the editor's keymaps. It mirrors GNU Emacs's evil-mode — plain Vim modal editing, no leader key. It is not on by default; Macros uses standard Emacs bindings unless you opt in.
Enable it from your init.scm (see Configuration):
(evil-mode) ; opt in to Vim-style modal editing
(evil-disable) ; turn it back off
The Rust side only decides when plain keys are commands (Normal/Visual states) versus text (Insert state); every binding is Scheme and fully overridable.
States
- Normal — keys are commands. This is where you start.
- Insert — keys insert text. Enter with i / a / o (and capitals); leave with Esc.
- Visual — character selection for operators. Enter with v.
Esc (keyboard-quit) always returns you to Normal.
Normal-state motions
| Key | Moves |
|---|---|
| h j k l | left / down / up / right |
| w / b | forward / backward a word |
| 0 / $ | start / end of line |
| g g / G | start / end of buffer |
Entering insert state
| Key | Action |
|---|---|
| i / I | insert before cursor / at first non-blank |
| a / A | append after cursor / at end of line |
| o / O | open a line below / above |
Changing text
| Key | Action |
|---|---|
| x | delete the character under the cursor |
| d d | delete the line |
| y y | yank the line (also copies to the system clipboard) |
| y w / y $ | yank a word / to end of line |
| p | paste |
| u | undo |
Normal-mode yanks copy to both the kill ring and the system clipboard, and restore the cursor to where the yank started — so y y then cmd-v in another app works.
Search
| Key | Action |
|---|---|
| / / ? | search forward / backward |
| n / N | next / previous match |
Ex commands
Press : to enter an Ex command. Substitution works as you'd expect:
:%s/old/new/g
Scrolling
| Key | Action |
|---|---|
| C-d / C-u | half-page down / up |
No leader key by default
Like vanilla evil-mode in Emacs, Macros' evil has no Space leader. A leader menu is a Doom/Spacemacs convention, not part of evil itself, so it's left to you. Adding one is a few lines in your init.scm:
;; Roll your own Spacemacs-style leader. evil-bind-key takes the command name
;; as a 'name symbol (a bare command identity or a string name work too).
(evil-bind-key "evil-normal" "space space" 'helm-execute-command)
(evil-bind-key "evil-normal" "space f f" 'helm-find-files)
(evil-bind-key "evil-normal" "space b b" 'helm-buffers)
Customizing
evil bindings live in the "evil-normal", "evil-insert", and "evil-visual" maps. Rebind exactly like any other key:
(define-key "evil-normal" "shift-q" 'kill-buffer)
Because it's all Scheme, you can add operators, text objects, and leader sub-maps of your own. See Scripting with Steel.