Navdeep Rana
Navdeep Rana

Reputation: 121

Vim disable autofold when I scroll down?

I have folding enabled in vim, here is .vimrc snipet.

set foldmethod=syntax
set foldnestmax=1
set foldlevel=0
set foldclose=all

It works fine, but when I scroll down a c-function it automatically folds, any idea on how to leave the fold open?

Upvotes: 3

Views: 490

Answers (1)

Ingo Karkat
Ingo Karkat

Reputation: 172698

Vim is just doing what you've instructed it to do; especially with your chosen combination of 'foldclose' and 'foldlevel'. From :help 'foldclose':

'foldclose' 'fcl'   string (default "")
        When set to "all", a fold is closed when the cursor isn't in it and
        its level is higher than 'foldlevel'.  Useful if you want folds to
        automatically close when moving out of them.

Simply drop the set foldclose=all if you don't like that behavior.

Upvotes: 3

Related Questions