Big picture of Vim commands
- Normal mode (default)
├── Navigation (h, j, k, l, G)
├── Editing (d, c, x)
├── Insert triggers (i, a, o, O, A)Insert mode → typing text
Visual mode → selecting text
Command mode (:) → commands like :w, :q, :10,20d
Navigation (movement commands)
GG→ go to last line
2. Editing / insertion commands
o, O, A : These change the file and switch you to insert mode.
| Command | Meaning |
|---|---|
o | open line below |
O | open line above |
A | append at end of line |
Tip
G o - create a new line below last line and start typing
Here,
- Shift + G → go to last line
- o → open new line + switch to insert mode
Delete
Delete from line X to line Y
:X,YdExample:
:10,20dShow line numbers:
:set numberDelete from current line → line 20
:.,20dHere . = current line
Delete from current line → next 10 lines
d10dDeletes current + next 10 lines
Delete with Visual mode
- Press:
Shift + V- Use ↑ ↓ to select lines
- Press:
dDelete entire file content
:%d