dotfiles icon indicating copy to clipboard operation
dotfiles copied to clipboard

save and restore last cursor position in vim

Open knutwalker opened this issue 11 years ago • 1 comments

This sets vim to save the cursor position on close/write and restores it on re-opening.

  • The set viminfo part is to unify and explicitly declare the .viminfo file (~/.viminfo is the default though)

  • The augroup cursor part restores the cursor

    The additional check is to ensure, that the restoring works properly on files with only one line

knutwalker avatar Jul 19 '12 10:07 knutwalker

Thanks!

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.

mathiasbynens avatar Jul 19 '12 10:07 mathiasbynens