Retrace your edits
g; or g,
Example
Normal mode, line 5, column 1. Separate changes are recorded at line 1, column 8, then line 3, column 8. The change-list pointer is after the newest entry.
name = Ada
role = editor
notesCursor on line 5, column 1name = Ada
role = editor
notesCursor on line 3, column 8name = Ada
role = editor
notesCursor on line 1, column 8name = Ada
role = editor
notesCursor on line 3, column 8Moves the cursor without undoing changes.
Details & Vim help
Return to places you edited: g; goes back through edits, and g, goes forward again.
Find the code you recently edited after reading elsewhere.
This moves the cursor; it does not undo edits. Nearby changes may share one list entry.
The example ends after g; then g; then g,. Only the cursor moves; none of the edits are undone.
Try it in Vim
- Make separate edits in different parts of the same buffer, then move elsewhere.
- With the change-list pointer after the newest entry, press g; in Normal mode to visit that edit. Press it again to visit an older edit.
- Press g, to move toward a newer edit. Use :changes to inspect the recorded locations.