I want aggressive code folding in Python.
I want folded code to read like a structured table of contents that I can just directly dive into by opening folds. I don’t want anything smaller than function/method definitions folded (no folding brackets or if, while, etc.). I want python @properties
and docstrings folded with their methods/classes/etc. When fully-folded, I really just want functions, classes, methods, other class attributes, and all top-level variables/code to show up, and no whitespace except between non-class non-function top-level code (I can comment a line, if I want whitespace there).
vim-coiled-snake
is really, really close to what I want (I’d like it to fold more whitespace), but it makes the editor so slow it’s unusable (it sometimes takes 10+ seconds to delete a single line).
Folding all code with zM
, jumping around, then unfolding code as I find what I’m after just feels like the “right” way to browse code, and it’s how I interact with vim most often. It seems so obvious, that I can’t believe it’s so hard to find a working solution. It makes me wonder, am I trying to do something dumb? Is there a better way? Is there a working solution I don’t know about?