vimrc: tweak save_cursor_position augroup

This commit is contained in:
surtur 2022-10-30 04:09:01 +01:00
parent bbc76bc4cd
commit eae61fe67c
Signed by: wanderer
SSH Key Fingerprint: SHA256:MdCZyJ2sHLltrLBp0xQO0O1qTW9BT/xl5nXkDvhlMCI

@ -801,8 +801,11 @@ augroup END
" when quitting a file, save the cursor position " when quitting a file, save the cursor position
augroup save_cursor_position augroup save_cursor_position
if &filetype !~# 'commit\|rebase'
autocmd! autocmd!
autocmd BufReadPost * call setpos(".", getpos("'\"")) " also automatically open any folds the cursor might land on.
autocmd BufReadPost * silent! normal! g`" zv
endif
augroup END augroup END
" when not running in a console or a terminal that doesn't support 256 colors " when not running in a console or a terminal that doesn't support 256 colors