126

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?

MSeifert
  • 145,886
  • 38
  • 333
  • 352
SmCaterpillar
  • 6,683
  • 7
  • 42
  • 70
  • 6
    http://www.jetbrains.com/idea/webhelp/configuring-autofolding-behavior.html – Gustavo Meira Aug 05 '14 at 09:28
  • 2
    Thanks! And I kept searching for "hide imports", "unfold imports", did not know there was a general setting for "code folding" :-) – SmCaterpillar Aug 05 '14 at 09:32
  • 1
    Thanks for asking this. I really don't like the defaults on this IDE. Fighting "features" like whack-a-mole is really not my cup of tea. – AndreasT Dec 05 '22 at 13:09

2 Answers2

160

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

Gustavo Meira
  • 2,875
  • 3
  • 21
  • 33
34

Pycharm 2016 settings

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

Hamish Downer
  • 16,603
  • 16
  • 90
  • 84
Lukasz Deptula
  • 361
  • 3
  • 7