treesit-fold icon indicating copy to clipboard operation
treesit-fold copied to clipboard

Command to fold everything under a level? analogous to `hs-hide-level`

Open nasseralkmim opened this issue 1 year ago • 4 comments

Is there such command?

nasseralkmim avatar Aug 08 '24 11:08 nasseralkmim

Something like #14? 🤔

jcs090218 avatar Aug 08 '24 12:08 jcs090218

It is a similar idea, actually cycling would be even better. The hs-hide-level hides everything below the current level. If you are at a function level, you hide if-statements, for example. At the module level, it hides the functions.

nasseralkmim avatar Aug 08 '24 14:08 nasseralkmim

👍 for a hs-hide-level analogous, I heavily rely on hs-hide-level everyday but it's quite buggy. Tried treesit-fold and works very good, but it's missing this functionality.

The functionality can be replicated by doing the following

  • selecting everything in the body (within {})
  • narrow to region
  • run treesit-fold-close-all
  • widen

danielpza avatar May 24 '25 08:05 danielpza

The functionality can be replicated by doing the following

Ah, now I fully understand the feature request. I've been a little busy recently, so I probably would not have time for this. 😓

Anyway, feel free to open a PR for this! ;)

jcs090218 avatar May 24 '25 14:05 jcs090218