Closed sorin-ionescu closed 12 years ago
Strange, gitv doesn't fold automatically for me at all.
I tried clearing my vimfiles (mv ~/.*vim* ~/bak
) and then getting gitv and now it does fold and consistently: even if I expand a fold with zo
. Maybe you have another plugin interfering with gitv? (Like I do.)
(I'm using gitv 1dfac94.)
gitv should always start with all folds open. Can you verify this isn't another plugin interfering by disabling any other plugins you use? Also this could be an autocmd you have setup that changes the 'foldlevel' option.
I can confirm that I also have this issue. I'm on Mac OS X Lion, using the vim plugins Janus (which incorporates Fugitive), and Vimwiki.
As previously mentioned, this is very likely to be another plugin interfering as my tests with vanilla Vim confirms that folding works. You could try running these commands and letting me know the output. It may help narrow things down.
:verbose set foldenable?
:verbose set foldlevel?
:verbose set foldlevelstart?
:verbose set foldmethod?
:verbose set foldnestmax?
1. foldenable
2. foldlevel=0
Last set from ~/.vim/plugin/gitv.vim
3. foldlevelstart=-1
4. foldmethod=syntax
Last set from ~/.vim/plugin/gitv.vim
5. foldnestmax=20
Ah! I see what's happening here. Sorry, I thought you meant the gitv window was starting completely folded. I didn't realise you meant the fugitive window.
Ok, looking at the code you have two choices for a fix.
silent setlocal foldlevel=0
.Something like
augroup git
au!
autocmd FileType git :setlocal foldlevel=99
augroup END
should do it.
I'll try and add an option or something to the next version of gitv.
Let me know if you still have any problems.
Thanks,
Greg
The below works for me. :-D
augroup git
au!
autocmd FileType git :setlocal nofoldenable
augroup END
Please prevent folding when first displaying gitv. After
zo
, on each subsequent pressing of RETURN, it no longer folds.