Reach a line or buffer boundary

0 of 5

The technique

Your textVim mode: Normal
Go to the first character of the comment, past the spaces. Before: // review notes. After: // review notes.

0 would stop on the first space. ^ skips the indent and lands on the first real character.

Keys in this lesson

0
Start of the line.
^
First character that is not a space.
$
End of the line.
gg
First line.
G
Last line.
3G
Line 3.

Before this lesson: Choose a word destination.

More about this lesson

Distinguish column zero, first nonblank, line end and file destinations.

0 reaches column zero, ^ the first nonblank character and $ the last character. gg reaches the first line; G the last. A count before G names a line: 3G reaches line 3. Follow a line jump with 0 when the exact column matters.

Example

On “ review notes”, 0 lands on the first space, ^ on r and $ on s. On a longer document, gg0 establishes the first line and first column regardless of the previous cursor position.

Use Reset to try again.

Guides on this topic

Exercise 1 of 5

0keys

par 1

Reach column zero, including the indentation. Finish on line 2, column 1, without changing the text.

Your textVim mode: Normal

Desired result

Yours

Par

Keyboard shortcuts
Ctrl+Enter
Check the result
Ctrl+Alt+U
Undo the last change
Ctrl+Alt+H
Show the next hint
Ctrl+Alt+R
Reset the exercise
Ctrl+Alt+P
Previous exercise
Ctrl+Alt+N
Next exercise
Enter
After a solve: the next step

Ctrl+Alt shortcuts leave Vim's own keys alone. On a Mac, Control and Option.