This is covered by the documentation, see :help markdown-folding-configuration
. Put the following into your ~/.vimrc
:
let g:markdown_fold_style = 'nested'
Question
Still really new to vim, I have the following question: having installed this vim plugin, how to enable that a fold of, e.g, a section collapses all sub-sections? I don't have to stick to the referenced plugin, any other will do as well.
The current status, for example, is (I'm trying to visualize how my vim looks like):
# Section 1 [4 lines]------------------....
## SubSection 1 [3 lines]--------------....
## SubSection 2 [10 lines]-------------....
# Section 2 [5 lines]------------------....
## SubSection 1 [5 lines]--------------....
What I would like to get in addition is:
# Section 1 [19 lines]------------------....
# Section 2 [11 lines]------------------....
Unfolding this state results again in the first example.
Best, /nm
Solution
This is covered by the documentation, see :help markdown-folding-configuration
. Put the following into your ~/.vimrc
:
let g:markdown_fold_style = 'nested'