This sets vim to save the cursor position on close/write and restores it on re-opening.
The augroup cursor part restores the cursor
The additional check is to ensure, that the restoring works properly on files with only one line
save and restore last cursor position in vim
If I pull this in, I’ll probably use ~/.vim/info instead of ~/.viminfo (cfr. ~/.vim/swaps etc.). Not sure if I really need this feature though… Let me think about it.