diff --git a/.vim/vimrc b/.vim/vimrc index 85989a4..717ce4d 100644 --- a/.vim/vimrc +++ b/.vim/vimrc @@ -801,8 +801,11 @@ augroup END " when quitting a file, save the cursor position augroup save_cursor_position + if &filetype !~# 'commit\|rebase' 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 " when not running in a console or a terminal that doesn't support 256 colors