How do I automatically fold code based on indentation level?
:set foldmethod=indent
Setting foldmethod=indent tells Vim to create folds based on the indentation level of each line.
3 results for "zc close fold"
:set foldmethod=indent
Setting foldmethod=indent tells Vim to create folds based on the indentation level of each line.
zf{motion}
Vim supports several fold methods, but manual folding with zf gives you precise control over exactly which lines to collapse.
zj and zk
How it works When working with folded code in Vim, you often want to skip from one fold to another without unfolding anything.