Moving back to the last cursor position in line in vim


Ever have a stray keystroke in vim that jumped to somewhere you didn’t intend to go?

Two backticks `` will jump to the exact position of where you were.
Two single quotes '' will jump to the first non-blank character where you were.

This also works for moving to the beginning of a line/cursor position set by a mark (

m{a-zA-z}

)

More explanation can be found at :help mark-motions.


%d bloggers like this: