Code blocks have folding toggles at 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, inner and anonymous classes, method bodies, import lists, comments, HTML and XML tags , closures and language injections .
- Click the toggles or .
- Place the caret within the desired block, and choose or on the main menu, or just press .
- On the main menu, choose or .
Pressingonce expands all blocks except the imports list. Repeating the keystroke expands the imports.