Based on i; first move to the '^ mark
gi
Example
Normal 0 / 3Insert 1 / 3Insert 2 / 3Normal 3 / 3one tworedCursor on line 1, column 1one tworedInsertion point on line 1, column 11one tworedXInsertion point on line 1, column 12one tworedXCursor on line 1, column 11Based on i; first move to the '^ mark.
Local marks
- '[
line 1, column 8- ']
line 1, column 11- '^
line 1, column 11- '.
line 1, column 8
Insert mode · type next text or Esc
Local marks
- '[
line 1, column 8- ']
line 1, column 11- '^
line 1, column 11- '.
line 1, column 8
Insert mode · type next text or Esc
Local marks
- '[
line 1, column 8- ']
line 1, column 11- '^
line 1, column 11- '.
line 1, column 11
Command applied
Local marks
- '[
line 1, column 11- ']
line 1, column 12- '^
line 1, column 12- '.
line 1, column 11
Before & after
one tworedCursor on line 1, column 1Local marks
- '[
line 1, column 8- ']
line 1, column 11- '^
line 1, column 11- '.
line 1, column 8
one tworedXCursor on line 1, column 11Local marks
- '[
line 1, column 11- ']
line 1, column 12- '^
line 1, column 12- '.
line 1, column 11
Start in Normal mode. A prior Ared followed by Esc appended red to the line, then 0 moved away. gi returns to the remembered last insertion position before the displayed X is typed.
Details & Vim help
Example replayed in Vim
Based on i; first move to the '^ mark. Use in Normal mode. Availability and exact behavior can depend on Vim build features, options, mappings and editor state; the linked help is authoritative.