Leave and return deliberately

0 of 1

The technique

Your textVim mode: Normal
Visit the end of the file, then come back. Before: top note / middle / end. After: top note / middle / end.

G is a jump, so Vim remembers where you were. Ctrl-o returns there, to the same column.

Keys in this lesson

Ctrl-o
Back to where you were before a jump.
Ctrl-i
Forward again.
ma
Set mark a here.
`a
Return to mark a, to the exact column.

Before this lesson: Buffer destinations.

More about this lesson

Visit another location and return through jump history or a named mark.

A large jump such as G is remembered in the jump list. Ctrl-o goes to an older jump position; Ctrl-i goes forward again. ma stores position a; backtick followed by a returns to its exact column. A return task requires the outward visit too.

Example

From a note near the top, G then Ctrl-o returns after visiting the end. ma, G, then backtick-a returns to your explicit mark instead of depending on jump history.

Use Reset to try again.

Guides on this topic

Exercise 1 of 1

0keys

par 2

Visit the last item, then return to your original position without editing. Finish at line 1, column 1.

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.