How do I make pyCharm stop hiding (unfold) my Python imports?

PythonImportPycharmCode Folding

Python Problem Overview


Every time I open a Python file PyCharm will hide all imports and shows:

import ...

within the editor.

I have to manually unfold it to see the imports. Where do I find the setting to undo auto-hiding of import statements?

Python Solutions


Solution 1 - Python

As this question may be useful for people who also are not looking for the term "code folding", I'll make my comment an answer.

As extracted from IntelliJ IDE Web Help, but also worked on PyCharm CE 3.4.1:

  1. Open the IDE Settings (File > Settings, or Ctrl+Alt+S).
  2. Under the "Editor" node, click "General" and then "Code Folding". The "Code Folding" page is displayed.
  3. In the "Collapse by default list", select the check boxes to the left of the code constructs you want to be displayed collapsed. So here you can uncheck "Imports".
  4. Apply changes.

The image below shows what it looks like:

enter image description here

Solution 2 - Python

Pycharm 2016 settings

Actually in pycharm 2016.1 it's Editor -> General -> Code Folding

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionSmCaterpillarView Question on Stackoverflow
Solution 1 - PythonGustavo MeiraView Answer on Stackoverflow
Solution 2 - PythonLukasz DeptulaView Answer on Stackoverflow