Is it possible to go back to the previous edit place in vim ? I know use mark one can move back and forth between different places within a file , but I don't know whether or not vim could automatically remeber the previous edit place for you .
+8
A:
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 '.
Al
2010-01-25 09:38:06
This uses the jumplist, so will only work if a 'jump' was used after editing. If you just scrolled with the mouse and clicked on a new location, it'll fail.
Al
2010-01-25 09:41:05
...and `:ju[mps]` to show the jump history (which is fixed at 100, though there is a separate jump list per window).
Jay
2010-01-25 09:42:21
With all due respect, if anyone is using the mouse in Vim, they're missing the point entirely.
Jay
2010-01-25 09:43:40
...but for the record, Al, I upvoted your answer.
Jay
2010-01-25 09:46:16
Can't argue with that (although I am _very_ occasionally guilty of reaching for the scroll-wheel...)
Al
2010-01-25 13:07:59
+4
A:
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
vorpyg
2010-01-25 09:55:48