how to jump back to the previous edit place

Is it possible to go back to the previous edit place in vim? I know using marks, one can move back and forth between different places within a file, but I don't know whether or not vim could automatically remember the previous edit place for you.


Solution 1:

I use the following (from the documentation):

g;          Go to [count] older position in change list.

g,          Go to [count] newer cursor position in change list.

Do :help g, to read more about this

Solution 2:

The last change is held in the mark named . so you can jump to the mark with `. (backtick, dot) or '. (apostrophe, dot). See:

:help mark-motions
:help '.