Folding and Expanding Code Blocks
Code blocks have folding toggles on the right edge of the gutter next to each block. When a block is folded, the toggle appears to the left of the first line of the block. When a block is expanded, the toggle is shown at the beginning of the block and at its end.
Folding and expanding code blocks works for entire classes, method bodies, import lists, comments, HTML and XML tags
You can fold (collapse) and unfold (expand) code blocks by using:
- Code folding toggles (, or ). These toggles are shown in the editor on the left of the corresponding blocks. If a block is unfolded, indicates the beginning of the block while is located at its end. For folded blocks, the toggle is shown as .
- Commands of the Folding menu. The Folding menu can be accessed from the main menu bar ( ), or as a context menu in the editor.
- Keyboard shortcuts. The corresponding shortcuts are shown in the Folding menu.
|Expand||⌘+||Expand the current code block|
|Collapse||⌘-||Collapse the current code block|
|Expand All||⇧⌘+||Expand all code blocks in the selected area, or in the current file if no area is selected|
|Collapse All||⇧⌘-||Collapse all code blocks in the selected area, or in the current file if no area is selected|
|Expand doc comments||N/A||Expand all documentation comments in the current file|
|Collapse doc comments||N/A||Collapse all documentation comments in the current file|
|Fold Selection / Remove region||⌘.||Collapse the selected fragment / Expand the selected fragment and make it "unfoldable"|