Skip to main content

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.

Core Idea

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​

KeyAction
h j k lMove left/down/up/right
w / bNext / previous word start (first letter)
e / geNext / previous word end (last letter)
0 / $Line start / end
^First non-blank character
gg / GFile start / end
Ctrl+d / Ctrl+uScroll half page down/up
Ctrl+f / Ctrl+bScroll full page down/up
Alt+d / Alt+uScroll half page down/up (custom)
Alt+Shift+d / Alt+Shift+uScroll full page down/up (custom)
ddDelete current line
yyYank (copy) current line
p / PPaste after / before
uUndo
Ctrl+rRedo
xDelete character under cursor (same as dl)
/patternSearch forward
n / NNext / previous match
.Repeat last change
Custom Alt Scrolling

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​

KeyWhere cursor ends up
iBefore cursor
aAfter cursor
IStart of line (first non-blank)
AEnd of line
oNew line below, cursor there
ONew line above, cursor there
sDelete char, enter insert
SDelete line, enter insert
giRe-enter insert at last insert position
LazyVim Note

LazyVim remaps s to a search plugin (flash.nvim), overriding Vim's default "substitute char". Use these alternatives instead:

GoalAlternative
Delete 1 char + Insertcl (change right) or xi (delete char then insert)
Delete line + Insertcc (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:

KeyAction
Ctrl+hDelete previous character (backspace)
Ctrl+wDelete previous word
Ctrl+uDelete to start of line
Ctrl+n / Ctrl+pNext/previous autocomplete suggestion
Ctrl+tIndent current line
Ctrl+dUn-indent current line
Ctrl+r {reg}Insert contents of register
Ctrl+o {cmd}Execute one Normal mode command, return to Insert
The Ctrl+o Trick

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.

KeyMode
vCharacter-wise visual
VLine-wise visual
Ctrl+vBlock (column) visual
gvRe-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.

CommandAction
:wWrite (save)
:qQuit
:wqWrite and quit
:q!Force quit without saving
:e filenameOpen/edit file
:vsVertical split
:spHorizontal split
:%s/old/new/gGlobal search and replace
:set numberEnable 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:

DisplayMode
(empty or NORMAL)Normal
-- INSERT --Insert
-- VISUAL --Visual
-- VISUAL LINE --Visual Line
-- VISUAL BLOCK --Visual Block
-- REPLACE --Replace

Mode Switching Quick Reference​

FromToKeys
NormalInserti, a, o, O, I, A
InsertNormalEsc
NormalVisualv
NormalVisual LineV
NormalVisual BlockCtrl+v
NormalCommand:
Any visual modeNormalEsc
CommandNormalEnter or Esc

Common Mode Mistakes​

MistakeWhat it looks likeFix
Typing in Normal modeCommands fire instead of textPress u to undo, then i to insert
Stuck in Command mode: at bottomPress Esc
Forgot you're in InsertMotions type lettersPress Esc
Ctrl+c vs EscCan leave pending operationsUse Esc as default; Ctrl+c for interruptions

Practice​

Practice File

Open the step-by-step drills: practice-folder/nvim/02-modal-editing/modes-practice.md (also available via the shell alias n02-modes).

DrillWhat it trainsSteps
^ vs 0First non-blank vs column 0At end of line → ^ → 0 → toggle; repeat on 4 lines
Insert shortcutsCtrl+w, Ctrl+u, Ctrl+t/dA → type text → Ctrl+w x4 → Ctrl+u → re-indent with Ctrl+d
Ctrl+rInsert a registeryy a line → i → Ctrl+r "
Ctrl+oOne Normal cmd from InsertA → Ctrl+o j down a line, still in Insert
Visual v / V / BlockSelection + operatorsv3w d; Vjj y; Ctrl+v 2j I + FRUIT: + Esc
Replace ROverwrite textR → overtype → Esc → u
Command-lineFile/window ops:w, :e, :vs, :sp, Ctrl+w w, Ctrl+w q

In LazyVim​

LazyVim Context

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 &lt;leader&gt; or g, a popup will show available keymaps.

AspectVanilla NeovimLazyVim
Core ModesNormal, Insert, VisualSame
Mode DiscoveryManual memorywhich-key.nvim popup

What's Next​