Neovim is a modal editor - every mode has a distinct purpose. This article covers the three modes you’ll use alongside Normal mode: Insert, Visual, and Command.
Insert Mode Variants
Entering Insert mode is intentional; there are several entry points depending on where you want the cursor:
| Key | Action |
|---|---|
i | Insert before current character |
a | Insert after current character |
A | Append at end of line |
o | Open new line below + enter Insert mode |
O | Open new line above + enter Insert mode |
Esc | Return to Normal mode |
Visual Mode
Visual mode lets you select text before applying an operator.
| Key | Action |
|---|---|
v | Start character-wise visual selection |
V | Start line-wise visual selection |
r | Replace 1 character under cursor |
R | Enter Replace mode (overwrite continuously) |
After selecting with v or V, apply any operator - d to delete, y to yank, c to change.
Command Mode (:)
Command mode accepts Ex commands. Press : from Normal mode to enter it.
| Command | Action |
|---|---|
:w | Save file |
:wq | Save and quit |
:q! | Quit, discarding changes |
:s/the/gc | Substitute on current line with confirm |
:%s/the/Athe/gc | Global substitution across the whole file |
Tips
- Always return to Normal mode (
Esc) before navigating - it’s the hub. - Use
o/Oinstead of going to end of a line and pressing Enter. :wqand:q!are the two most muscle-memoried commands in Neovim.