The editor supports optional folding for Python, C, C++, Java, Javascript, HTML, Eiffel, Lisp, Ruby, and a number of other file formats. This allows you to visually collapse logical hierarchical sections of your code while you are working in other parts of the file.

You can turn folding on and off as a whole with the Enable Folding preference.

The Fold Line Mode preference can be used to determine whether or not a horizontal line is drawn at fold points, whether it is drawn above or below the fold point, and whether it is shown when the fold point is collapsed or expanded. Fold Indicator Style is used to select the look of the fold marks shown at fold points.

Once folding is turned on, an additional margin appears to the left of source files that can be folded. Left mouse click on one of the fold marks in this margin to collapse or expand that fold point. Right mouse clicking anywhere on the fold margin displays a context menu with the various folding operations.

You can also hold down the following key modifiers while left-clicking to modify the folding behavior:

Fold commands are also available in the Folding section of the Source menu, which indicates the key equivalents assigned to the operations: