Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to fold all comments in pycharm

Tags:

pycharm

I've recently been editing files with a lot of long comments. I find myself folding lots of them manually, is there a way to fold all of these at once, using some kind of menu entry or keyboard shortcut?

like image 300
simonzack Avatar asked Feb 14 '16 14:02

simonzack


2 Answers

I came to this question recently with the same one, but I've ince found it is possible to do this in recent pycharms. In pycharm 2020.3 (and possibly earlier versions, but that's the one I'm using), there is now an option to "Collapse Doc Comments", which appears to do what you need! It collapsed all the docstring comments in my file and ignored all other collapsible portions of code.

Code -> Folding -> Collapse Doc Comments

enter image description here

like image 126
Jgd Avatar answered Oct 05 '22 12:10

Jgd


Press (Command) and +(key) to expand and use -(key) to collapse

like image 36
webapp Avatar answered Oct 05 '22 12:10

webapp