Understanding Modes
Modes are the cornerstone of Vim/Neovim's design. Each mode gives your keyboard keys a different meaning. Fluency in modes is the foundation of efficient editing.
In Normal mode, keys are commands. In Insert mode, keys type text. You should spend most of your time in Normal mode and only enter Insert mode when actually adding new text.
Mode Overview
1. Normal Mode — Your Home Base
Normal mode is the default. Every key press triggers a command — move, delete, yank, search.
You can tell you're in Normal mode: no mode indicator at bottom left
(or "NORMAL" if you have a status line configured)
Essential Normal Mode Keys
| Key | Action |
|---|---|
| h j k l | Move left/down/up/right |
| w / b | Next / previous word start (first letter) |
| e / ge | Next / previous word end (last letter) |
| 0 / $ | Line start / end |
| ^ | First non-blank character |
| gg / G | File start / end |
| Ctrl+d / Ctrl+u | Scroll half page down/up |
| Ctrl+f / Ctrl+b | Scroll full page down/up |
| Alt+d / Alt+u | Scroll half page down/up (custom) |
| Alt+Shift+d / Alt+Shift+u | Scroll full page down/up (custom) |
| dd | Delete current line |
| yy | Yank (copy) current line |
| p / P | Paste after / before |
| u | Undo |
| Ctrl+r | Redo |
| x | Delete character under cursor (same as dl) |
| /pattern | Search forward |
| n / N | Next / previous match |
| . | Repeat last change |
The Alt scroll keys are personal keymaps, not vanilla Vim defaults, defined in lua/config/keymaps.lua. Alt+d/Alt+u delegate to Ctrl+d/Ctrl+u (half page), and Alt+Shift+d/Alt+Shift+u delegate to Ctrl+f/Ctrl+b (full page). The original Ctrl motions keep working.
2. Insert Mode — When You Actually Type
Enter Insert mode to add or modify text, then exit with Esc. Every entry command drops the cursor at a different position, so pick the one that matches where you want to start typing.
Read each diagram like a ruler: the text sits on top, and every ^ marks a spot where the cursor can land.
Cursor starts on the w of world:
hello world
^
cursor
How to Enter Insert Mode
| Key | Where cursor ends up |
|---|---|
| i | Before cursor |
| a | After cursor |
| I | Start of line (first non-blank) |
| A | End of line |
| o | New line below, cursor there |
| O | New line above, cursor there |
| s | Delete char, enter insert |
| S | Delete line, enter insert |
| gi | Re-enter insert at last insert position |
LazyVim remaps s to a search plugin (flash.nvim), overriding Vim's default "substitute char". Use these alternatives instead:
| Goal | Alternative |
|---|---|
| Delete 1 char + Insert | cl (change right) or xi (delete char then insert) |
| Delete line + Insert | cc (change line) — S still works in LazyVim |
i, a, I, A — land somewhere on the current line
The cursor starts on the w of world:
hello world
^
cursor
i — insert before the cursor
hello world
^
i → insert before 'w'
a — insert after the cursor
hello world
^
a → insert after 'w' (before 'o')
I — insert at start of line (first non-blank)
hello world
^
I → start of line
A — insert at end of line
hello world
^
A → after the last character
o and O — open a brand-new line
hello world
^
o opens a new empty line below
^
hello world
O opens a new empty line above
Both new lines auto-indent to match the current line.
s and S — delete first, then insert
hello world
^
s deletes the 'w' under the cursor, then inserts
hello world
^^^^^^^^^^^
S deletes the whole line, then inserts
Insert Mode Shortcuts
Even in Insert mode, some shortcuts are available without leaving:
| Key | Action |
|---|---|
| Ctrl+h | Delete previous character (backspace) |
| Ctrl+w | Delete previous word |
| Ctrl+u | Delete to start of line |
| Ctrl+n / Ctrl+p | Next/previous autocomplete suggestion |
| Ctrl+t | Indent current line |
| Ctrl+d | Un-indent current line |
| Ctrl+r {reg} | Insert contents of register |
| Ctrl+o {cmd} | Execute one Normal mode command, return to Insert |
Ctrl+o lets you run one Normal mode command without leaving Insert mode. Ctrl+o A jumps to end of line and returns to Insert. Ctrl+o dd deletes a line and returns to Insert.
3. Visual Mode — Select and Act
Visual mode lets you select text, then apply operators to the selection.
| Key | Mode |
|---|---|
| v | Character-wise visual |
| V | Line-wise visual |
| Ctrl+v | Block (column) visual |
| gv | Re-select previous selection |
In Visual Mode
Select with motions, then apply operators:
v3w → Select 3 words
V5j → Select 5 lines
Ctrl+v 3j → Select 3 rows of a column
Then:
d → delete selection
y → yank selection
c → change selection
> → indent selection
< → un-indent selection
~ → toggle case
u → lowercase
U → uppercase
Visual Block (Column Editing)
Use Visual Block when you need to edit the same column across many lines, such as adding prefixes, aligning text, or toggling a repeated pattern.
Example — add // comment prefix to 3 lines:
Ctrl+v → Block visual start
2j → Select 3 lines down
I → Insert before block
// → Type the prefix
Esc → Apply to all lines
4. Command-line Mode — Running Commands
Entered via :. Used for file operations, settings, and search/replace.
| Command | Action |
|---|---|
| :w | Write (save) |
| :q | Quit |
| :wq | Write and quit |
| :q! | Force quit without saving |
| :e filename | Open/edit file |
| :vs | Vertical split |
| :sp | Horizontal split |
| :%s/old/new/g | Global search and replace |
| :set number | Enable line numbers |
| :help {topic} | Open help |
5. Replace Mode
Replace mode overwrites characters as you type (like Insert with the Insert key in other editors):
R → Enter Replace mode
Backspace → Undo the replacement
Esc → Return to Normal mode
Checking Current Mode
Look at the bottom-left of the Neovim window:
| Display | Mode |
|---|---|
| (empty or NORMAL) | Normal |
| -- INSERT -- | Insert |
| -- VISUAL -- | Visual |
| -- VISUAL LINE -- | Visual Line |
| -- VISUAL BLOCK -- | Visual Block |
| -- REPLACE -- | Replace |
Mode Switching Quick Reference
| From | To | Keys |
|---|---|---|
| Normal | Insert | i, a, o, O, I, A |
| Insert | Normal | Esc |
| Normal | Visual | v |
| Normal | Visual Line | V |
| Normal | Visual Block | Ctrl+v |
| Normal | Command | : |
| Any visual mode | Normal | Esc |
| Command | Normal | Enter or Esc |
Common Mode Mistakes
| Mistake | What it looks like | Fix |
|---|---|---|
| Typing in Normal mode | Commands fire instead of text | Press u to undo, then i to insert |
| Stuck in Command mode | : at bottom | Press Esc |
| Forgot you're in Insert | Motions type letters | Press Esc |
| Ctrl+c vs Esc | Can leave pending operations | Use Esc as default; Ctrl+c for interruptions |
Practice
Open the step-by-step drills: practice-folder/nvim/02-modal-editing/modes-practice.md
(also available via the shell alias n02-modes).
| Drill | What it trains | Steps |
|---|---|---|
^ vs 0 | First non-blank vs column 0 | At end of line → ^ → 0 → toggle; repeat on 4 lines |
| Insert shortcuts | Ctrl+w, Ctrl+u, Ctrl+t/d | A → type text → Ctrl+w x4 → Ctrl+u → re-indent with Ctrl+d |
Ctrl+r | Insert a register | yy a line → i → Ctrl+r " |
Ctrl+o | One Normal cmd from Insert | A → Ctrl+o j down a line, still in Insert |
Visual v / V / Block | Selection + operators | v3w d; Vjj y; Ctrl+v 2j I + FRUIT: + Esc |
Replace R | Overwrite text | R → overtype → Esc → u |
| Command-line | File/window ops | :w, :e, :vs, :sp, Ctrl+w w, Ctrl+w q |
In LazyVim
LazyVim inherits all Neovim modal editing — no changes to core behavior for normal mode. However, LazyVim bundles which-key.nvim. When you are in Normal mode and you press a prefix like <leader> or g, a popup will show available keymaps.
| Aspect | Vanilla Neovim | LazyVim |
|---|---|---|
| Core Modes | Normal, Insert, Visual | Same |
| Mode Discovery | Manual memory | which-key.nvim popup |