save and restore last cursor position in vim #88

wants to merge 1 commit into from

2 participants


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



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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment