Configuring Autofolding Behavior
PyCharm allows displaying source code in a folded form, making it really concise, and hiding from view the details you might consider less important. When a file is first opened for editing, certain code constructs can be shown folded. It is up to you to define the desired set of code constructs to be folded by default. When you hover your mouse pointer over the collapsed code fragment, its preview is displayed in a pop-up window.
To configure autofolding behavior in the editor
- Open the Settings/Preferences dialog box, expand the Editor and then General nodes, and then click Code Folding. Code Folding page is displayed.
- In the Collapse by default list, select the check boxes to the left of the code constructs you want to be displayed collapsed.
- Apply changes.
Now, when you first open files for editing, the selected code constructs will be shown as shaded, with the preview available at the mouse pointer.