is a number, which sets the width for a column on the side of the
window to indicate folds. When it is zero, there is no foldcolumn. A normal
value is auto:9. The maximum is 9.
An open fold is indicated with a column that has a '-' at the top and '|'
characters below it. This column stops where the open fold stops. When folds
nest, the nested fold is one character right of the fold it's contained in.
A closed fold is indicated with a '+'.
These characters can be changed with the 'fillchars' option.
Where the fold column is too narrow to display all nested folds, digits are
shown to indicate the nesting level.
The mouse can also be used to open and close folds by clicking in the
fold column:
- Click on a '+' to open the closed fold at this row.
- Click on any other non-blank character to close the open fold at this row.
OTHER OPTIONS
'foldenable' 'fen': Open all folds while not set.
'foldexpr' 'fde': Expression used for "expr" folding.
'foldignore' 'fdi': Characters used for "indent" folding.
'foldmarker' 'fmr': Defined markers used for "marker" folding.
'foldmethod' 'fdm': Name of the current folding method.
'foldminlines' 'fml': Minimum number of screen lines for a fold to be
displayed closed.
'foldnestmax' 'fdn': Maximum nesting for "indent" and "syntax" folding.
'foldopen' 'fdo': Which kinds of commands open closed folds.
'foldclose' 'fcl': When the folds not under the cursor are closed.
==============================================================================
4. Behavior of folds *fold-behavior*
When moving the cursor upwards or downwards and when scrolling, the cursor
will move to the first line of a sequence of folded lines. When the cursor is
already on a folded line, it moves to the next unfolded line or the next
closed fold.
While the cursor is on folded lines, the cursor is always displayed in the
first column. The ruler does show the actual cursor position, but since the
line is folded, it cannot be displayed there.
Many movement commands handle a sequence of folded lines like an empty line.
For example, the "w" command stops once in the first column.
When starting a search in a closed fold it will not find a match in the
current fold. It's like a forward search always starts from the end of the
closed fold, while a backwards search starts from the start of the closed
fold.
When in Insert mode, the cursor line is never folded. That allows you to see
what you type!
When using an operator, a closed fold is included as a whole. Thus "dl"
deletes the whole closed fold under the cursor.
For Ex commands that work on buffer lines the range is adjusted to always
start at the first line of a closed fold and end at the last line of a closed
fold. Thus this command: >
:s/foo/bar/g
when used with the cursor on a closed fold, will replace "foo" with "bar" in
all lines of the fold.
This does not happen for |:folddoopen| and |:folddoclosed|.
When editing a buffer that has been edited before, the last used folding
settings are used again. For manual folding the defined folds are restored.
For all folding methods the manually opened and closed folds are restored.
If this buffer has been edited in this window, the values from back then are
used. Otherwise the values from the window where the buffer was edited last
are used.
vim:tw=78:ts=8:noet:ft=help:norl: