Notgnoshi / dotfiles

Personal dotfiles and shell scripts

Home Page:https://agill.xyz

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Vim - using viminfo files restores last cursor position in gitcommit and gitrebase filetypes

Notgnoshi opened this issue · comments

Using nobuflisted only works for restoring buffers (the % viminfo option).

I think if a gitcommit or gitrebase filetype is opened, the cursor should be moved to the top with gg.

You can use

augroup doNotUseViminfoFor
    autocmd FileType gitcommit,gitrebase setlocal viminfo=
augroupEND

But you will need to delete references to COMMIT_EDITMSG and the rebase-todo files in your ~/.viminfo. This change only needs to be done once after this fix has been applied.