For getting comfortable at the terminal

3 chapters · 11 lessonsAbout 1.5 h

Vim Introduction

Beginner

A free course on Vim, the editor you will find on almost every server you SSH into. Learn to move, edit, and get out again, all in your browser.

This course continues from Terminal Introduction

About this course

Vim is on every server you SSH into. It is also what opens when you run `git commit` without `-m`. You can avoid it for a while, but not forever.

This course starts by permanently solving the "I cannot get out" problem in lesson 1. From there it covers motion, editing, search and replace, visual mode, and macros across three chapters and eleven lessons. Every exercise has you repeat the same moves in a few different places, so by the end your hands know what to do.

Every exercise is graded on the state you reach, not the keys you press. If you land on the right line, `3G`, `jjj`, and `/pattern` are all correct. There is never only one right way to do something in Vim.

Sample Lessons

Skills you'll learn

Thinking in Modes

Understand normal, insert, visual, and command-line mode, and move between them freely with Esc as your anchor.

The Grammar of Motion and Editing

Learn to combine operators with motions so you compose edits instead of memorizing commands.

Finishing Repetitive Work in One Go

Use search and replace, visual mode block editing, and macros to finish edits that would be painful by hand.

A page of the Vim cheat sheet

Vim Cheat Sheet

Every key from this course on one A4 page. The PDF is free and prints as is.

Who this course is for

Ever Got Stuck Inside Vim

The very first lesson hands you the way out. No more panic.

Need to Edit Files on a Server

When Vim is the only editor on the box, you will know enough to get the job done.

Curious About That Screen `git commit` Opens

Learn what it is, how to write in it, and how to close it.

Syllabus

3 chapters · 11 lessons

1Open, Save, and Quit

Keys and commands

Open, Save, and Quit

Practice →
vim README.md
Open a file
Esc
Back to normal mode
:w
Save
:q
Quit
:wq
Save and quit
:q!
Quit without saving
i
Type before the cursor
a
Type after the cursor
I
Type at the start of the line
A
Type at the end of the line
o
Open a new line below
O
Open a new line above

Moving the Cursor

Practice →
w
Next word
b
Previous word
0
Start of the line
$
End of the line
f
To the next character you type

Jump and Search

Practice →
gg
Top of the file
G
Bottom of the file
:38
Line 38
/
Search for the word you type
n
Next match

Delete, Copy, and Undo

Practice →
x
Delete a character
dd
Delete the line
3dd
Delete 3 lines (count first)
yy
Copy the line
p
Paste below (deleted lines too)
P
Paste above
u
Undo
Ctrl+r
Redo

Operators and Motions

Practice →
dw
Delete a word
cw
Change a word
d$
Delete to the end of the line
c$
Change to the end of the line
.
Repeat the last change

Text Objects

Practice →
diw
Delete the word under the cursor
daw
Delete the word and its space
ci"
Change inside quotes
ci(
Change inside parentheses

Search and Replace

Practice →
:s/2025/2026/
Replace on this line
:%s/http:/https:/g
Replace every match in the file
:%s/btn/button/gc
Confirm each one (y / n)

Visual Mode

Practice →
v
Select characters
V
Select lines
Ctrl+v
Select a block
d
Delete the selection
y
Copy the selection
>
Indent the selected lines
I
Type at the start of each line in a block
qa
Start recording into a
q
Stop recording
@a
Play it back
@@
Play it again
3@a
Play it 3 times
// READY?

BEGIN YOUR
JOURNEY

Join thousands of developers who've mastered the terminal. Your first lesson awaits.

Get Started →