Folding is a pretty complicated mechanism (see another answer I gave about folds for a nuanced discussion of folding scanning).
In order to give a complete answer we will need to see what type of plugins you are loading when booting up an instance of vim.
I'd bet that there are a few plugins that are mucking with the default vim settings (vim -u NONE
should have reproduced this). Any plugin that changes the foldmethod
is a likely cause (I'd try to remove them 1 by 1 and see what causes the issue)
If you don't want to muck with your plugins at all I'd recommend manually tweaking the syntax + parsing settings and then open a test buffer to confirm your functionality. It can be a frustrating journey to get it to play nicely but with some relentless digging in :help
you should be able to wrangle the beast that is folding.
vim -u NONE -U NONE -N
. It might be an issue with your vimrc or a plugin.vim -u NONE -U NONE -N fold-test
and just settingfoldmethod=marker
. I'm running Vim 7.4.712 on Arch. If I try the same with Vim on Vim 7.4.160 on CentOS 7, I get exactly the opposite results (all folds open when using:m+1
). And Vim 7.2.441 on CentOS 6 works fine... Allfold*
settings seem to be the same on these machines.