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.
5 results for "zM close all folds"
: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.
:windo set wrap
Vim provides iterator commands that execute an Ex command across all windows, buffers, tabs, or argument list files.
buffers-windows #buffers-windows #windo #bufdo #batch-commands
:windo / :bufdo / :tabdo {command}
Vim's do commands iterate over collections and execute a command in each context.
buffers-windows #buffers #windows #tabs #batch-editing #ex-commands