Vim Recall繁體中文

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

notes
Cursor on line 5, column 1

Moves 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

  1. Make separate edits in different parts of the same buffer, then move elsewhere.
  2. 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.
  3. Press g, to move toward a newer edit. Use :changes to inspect the recorded locations.