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?
As of writing (version 2016.2.3) there's no way to collapse just comments.
The closest is the Code > Folding > Expand all to level
menu items, but that folds everything by level. There are 5 levels available, with keyboard shortcuts:
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
Press (Command) and +(key) to expand and use -(key) to collapse
© 2022 - 2024 — McMap. All rights reserved.