Leave and return deliberately
The technique
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.