Repeat and reverse a character search

0 of 4

The technique

Your textVim mode: Normal
Jump to the second bar on the line. Before: north | centre | south. After: north | centre | south.

f| reaches the first bar and ; the next one. A comma would go back to the first.

Keys in this lesson

;
Repeat the last f, t, F or T.
,
Repeat it the other way.
2f|
Jump to the second | on the line.

Before this lesson: Character boundaries.

More about this lesson

Choose a later occurrence or reverse direction without searching another line.

f and F land on a character; t and T stop beside it. ; repeats the original direction, and comma reverses it. A count such as 2f| chooses the second occurrence. These commands stay on the current line; search with / when you need another line.

Example

In north | centre | south, f| reaches the first bar; ; reaches the second; comma returns to the first. Inspect the character that an operator will preserve.

Use Reset to try again.

Guides on this topic

Exercise 1 of 4

0keys

par 3

Reach the marked character boundary without changing the line. Finish at line 1, column 31.

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.