Reputation: 21625
Is there a Vim command which could returns the focus to the position be just edited? This is very useful after some code searching for edit.
Upvotes: 2
Views: 657
Reputation: 195059
I usually do g;
, jump back to the last changed position.
Note that, g;
will go to the last position in change list, that is, no matter your change was done in insert or normal mode, once it was in your change list, g;
is gonna bring you there.
You can keep pressing g;
to navigate your change list.
g,
is for opposite direction.
Upvotes: 6
Reputation: 161674
gi - Insert text in the same position as where Insert mode was stopped last time in the current buffer.
`^ or '^ - Jump to the position where the cursor was the last time when Insert mode was stopped.
`. or '. - Jump to the position where the last change was made.
Upvotes: 4