reddit / emacs

Fold docstrings on python files?

Gus_Gustavsohn · 2022-06-01 23:07
Emacs noob here. Is there a way to fold docstrings in python files? Thanks in advance!
MitchellMarquez42 · 2022-06-02 00:12
! Remindme 4d
lerobinbot · 2022-06-02 04:06
nice
gnieheh · 2022-06-02 05:59
[Elpy](https://github.com/jorgenschaefer/elpy) allows to do that with its [folding](https://github.com/jorgenschaefer/elpy/blob/master/elpy.el#L3199) module. If you don't want to install Elpy, the folding module is based on hideshow, so it should not be too hard to extract the code.
Gus_Gustavsohn · 2022-06-02 14:40
Thanks! Turns out I'm already using elpy, just didn't know about the folding module. I only needed to actually enable it (as it is not enabled by default in doom emacs apparently) and now it works. Thanks again for all your help.