Content #
- Each line of code in a file has a “foldlevel”. This is always either zero or a positive integer.
- Lines with a foldlevel of zero are never included in any fold.
- Adjacent lines with the same foldlevel are folded together.
- If a fold of level X is closed, any subsequent lines with a foldlevel greater than or equal to X are folded along with it until you reach a line with a level less than X.
Some rough “rules” for our folding(foldmethod is indent):
- lines that are indented should be folded together, and the previous line folded with them.
- Blank lines should be at the same level as later lines, so blank lines at the end of a fold won’t be included in it.