Vim folding - close all children recursively under the cursor

I know how to open all the folds under the cursor with zO.

But how to do the opposite?

I want something like za, but also with recursion.

PS. I know there is zC, but it closes all the parental folds with respect to the current line, and I want to close the children.

+3
source share
1 answer
  • Close parent folder
  • Select a closed fold and the next line
  • :foldc!- closes all folds in the range `<,`>(reads :h foldc)

You can obviously display this sequence.

+1
source

All Articles