1.1 โ Normal Mode โ The Command Center
1.1 โ Normal Mode โ The Command Center#
Normal mode is Vimโs default mode and where youโll spend most of your time. Understanding Normal mode is the key to unlocking Vimโs power.
What is Normal Mode?#
Normal mode is the command mode where keystrokes execute commands rather than inserting text. When you open Vim, you start in Normal mode.
Think of Normal mode as the โcontrol roomโ of your editor:
- Every key is a command
- You navigate, delete, copy, paste, and manipulate text
- You issue commands to other modes
Key Insight: In Vim, you spend more time editing existing text than writing new text. Normal mode optimizes for this reality.
Recognizing Normal Mode#
Youโre in Normal mode when:
- The cursor is a block (not a line)
- Thereโs no mode indicator at the bottom, OR it shows
-- NORMAL -- - Pressing letters doesnโt type them on screen
If youโre ever unsure what mode youโre in, press Esc to return to Normal mode.
Basic Normal Mode Commands#
Movement Commands#
| Command | Action |
|---|---|
h | Move left |
j | Move down |
k | Move up |
l | Move right |
w | Move to next word |
b | Move to previous word |
0 | Move to start of line |
$ | Move to end of line |
Editing Commands#
| Command | Action |
|---|---|
x | Delete character under cursor |
X | Delete character before cursor |
dd | Delete entire line |
D | Delete from cursor to end of line |
yy | Yank (copy) entire line |
p | Paste after cursor |
P | Paste before cursor |
u | Undo |
Ctrl-r | Redo |
Entering Other Modes#
| Command | Target Mode |
|---|---|
i | Insert mode (before cursor) |
a | Insert mode (after cursor) |
v | Visual mode (character) |
V | Visual mode (line) |
: | Command-line mode |
/ | Search forward |
? | Search backward |
The Philosophy of Normal Mode#
Commands are Composable#
Normal mode commands follow a grammar: [count][operator][motion]
d โ delete operator
w โ word motion
dw โ delete word
d3w โ delete 3 words
This composability means learning a few operators and motions gives you many commands.
The Dot Command#
The . (dot) command repeats your last change. This is incredibly powerful:
dwโ Delete a word- Move to another word
.โ Delete that word too
The dot command makes Normal mode edits repeatable without macros.
Counts Multiply Commands#
Most commands accept a count prefix:
| Command | Action |
|---|---|
5j | Move down 5 lines |
3w | Move forward 3 words |
2dd | Delete 2 lines |
10x | Delete 10 characters |
Common Normal Mode Workflows#
Deleting Text#
x โ Delete single character
dw โ Delete word (from cursor)
diw โ Delete inner word (whole word)
dd โ Delete line
d$ โ Delete to end of line
d0 โ Delete to start of line
Changing Text#
The c (change) operator deletes and enters Insert mode:
cw โ Change word
ciw โ Change inner word
cc โ Change entire line
c$ โ Change to end of line
Copying and Pasting#
yy โ Yank (copy) line
yw โ Yank word
y$ โ Yank to end of line
p โ Paste after cursor
P โ Paste before cursor
Returning to Normal Mode#
From any mode, press Esc to return to Normal mode:
| From Mode | Key | Alternative |
|---|---|---|
| Insert | Esc | Ctrl-[ |
| Visual | Esc | Ctrl-[ |
| Command-line | Esc | Ctrl-[ |
Many Vim users remap Caps Lock to Esc for easier access.
Practice Exercises#
Exercise 1: Basic Navigation#
- Open a file with multiple lines:
vim practice.txt - Use
jandkto move between lines - Use
handlto move within a line - Use
wandbto move by words - Use
0and$to jump to line boundaries
Exercise 2: Deletion Practice#
- Position cursor on a character, press
xto delete it - Position cursor on a word, press
dwto delete it - Press
ddto delete an entire line - Press
uto undo each deletion
Exercise 3: The Dot Command#
- Delete a word with
dw - Move to another word with
w - Press
.to delete it - Repeat step 2-3 several times
Exercise 4: Counts#
- Press
5jto move down 5 lines - Press
3wto move forward 3 words - Press
2ddto delete 2 lines - Undo with
u
Common Mistakes#
Accidentally Typing in Normal Mode#
If you start typing and see strange behavior (jumping around, deleting text), youโre in Normal mode. Press Esc, then u to undo, then i to enter Insert mode.
Forgetting Which Mode Youโre In#
Always look at the bottom of the screen for mode indicators. When in doubt, press Esc.
Using Arrow Keys#
Arrow keys work but break the flow. Train yourself to use hjkl โ itโs faster once learned.
Summary#
| Concept | Key Points |
|---|---|
| Normal Mode | Default mode, commands not text |
| Movement | hjkl, w, b, 0, $ |
| Operators | d (delete), c (change), y (yank) |
| Counts | Prefix commands with numbers |
| Dot Command | . repeats last change |
| Return to Normal | Esc from any mode |
Normal mode is Vimโs foundation. Master it, and every other mode becomes more powerful.