Modes, movement and a first edit

0 of 4

The technique

Your textVim mode: Normal
Remove the extra o at the end of typoo. Before: Fix the typoo.. After: Fix the typo..

In Normal mode, keys move the cursor or change text. Press i to start typing in Insert mode, and Esc to go back to Normal mode.

$ jumps to the end of the line and h moves one step left, onto the extra letter. x deletes it. You stay in Normal mode the whole time.

Keys in this lesson

hjkl
Left, down, up, right.
i
Insert before the cursor.
Esc
Back to Normal mode. It also cancels a command you've started.
$
End of the line.
x
Delete one character.
ciw
Change the word under the cursor.
u
Undo the last change.
Ctrl-r
Redo it.
More about this lesson

h moves left, j down, k up and l right. The cursor and the mode label show where you are.

Make your text match the result shown, then go back to Normal mode. u undoes the last edit, Ctrl-r redoes it, and Start over puts back the starting text.

Guides on this topic

Exercise 1 of 4

0keys

par 4

When the request fails, the error is created but never thrown. In Normal mode, press l to move right onto new. That's where throw goes.

Your textVim mode: Normal

Move the cursor here

6    if (!response.ok) new Error("Couldn't load your orders");

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
Start the exercise over
Ctrl+Alt+P
Previous exercise
Ctrl+Alt+N
Next exercise
Ctrl+Alt+K⌃⌥K
Show the keyboard shortcuts
Ctrl+Alt+F⌃⌥F
Turn focus mode on or off
Ctrl+Alt+S⌃⌥S
Open the editor settings
Enter
Go on to the next step after you finish

The Ctrl+Alt shortcuts don't clash with Vim's own keys. On a Mac, use Control and Option.