foldmethod option is local for each window.
manual– folds must be defined by entering commands.
indent– groups of lines with the same indent form a fold
syntax– folds are defined by syntax highlighting
expr– folds are defined by a user-defined expression
marker– special characters can be manually or automatically added to your text to flag the start and end of folds
diff– used to fold unchanged text when viewing differences (automatically set in diff mode)
Opening & Closing folds
|Vim folding command||Use to|
||close a fold (if the cursor is in an open fold)|
||open a fold (if the cursor is in a closed fold)|
||(toggle) operate on one level of folding, at the cursor|
||moves the cursor to the next/previous fold|
||increases/decrease the foldlevel by one|
||closes/open all folds|