First edits and modes

0 of 3

The technique

Your textVim mode: Normal
Put A in front of plan. The cursor is on the p. Before: const message = "plan";. After: const message = "A plan";.

i starts typing before the cursor. Esc ends the insertion and takes you back to Normal mode, where keys are commands again.

Keys in this lesson

i
Insert before the cursor.
Esc
Back to Normal mode. Also cancels a command you have started.
hjkl
Left, down, up, right.
x
Delete one character.
r
Replace one character with the next one you type.

Before this lesson: Start here: Your first Vim edit.

More about this lesson

Enter and leave Insert mode; move to a character and correct it.

Normal mode gives keys commands; Insert mode gives them text. i inserts before the cursor; Esc completes the insertion. h/j/k/l move left/down/up/right. x removes the character under the cursor. r followed by a character replaces just that character and stays in Normal mode.

Example

From the p in “plan”, i then “A ” then Esc makes “A plan”. From the a in “plam”, move right with l and type rn to repair the final letter. Watch the mode label before typing.

Use Reset to try again.

Guides on this topic

Exercise 1 of 3

0keys

par 9

Add “Please ” before the message. Finish in Normal mode.

Your textVim mode: Normal

Desired result

const message = "Please Read short reports";

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.