Is there a way to make vim not close the current fold I'm in when I close a file? For example: I am typing inside a fold, I save and close the file (without presing zc to close the fold), and then when I reopen the file the fold I was in is now closed and I have to open it again and scroll to where I was. Is there any way to prevent this from happening? I would like to be able to open the file and have the fold just how I left it, open, with my cursor in the same place it was. Here is my vimrc for folds and keeping the cursor where is was on the last closing of the file:
set foldmethod=manual
set foldnestmax=10
set foldlevel=2
"---- Auto save folding when closing file ----"
augroup AutoSaveFolds
autocmd!
autocmd BufWinLeave * mkview
autocmd BufWinEnter * silent loadview
augroup END
"---- Jump to last cursor location upon opening file ----"
if has("autocmd")
au BufReadPost * if line("'\"") > 0 && line("'\"") <= line("$")
\| exe "normal! g'\"" | endif
endif