Fold/Unfold headings up to specific level hotkeys

Here’s another (refinement on the) idea.

Let’s take an example.

H1

H2

H3

H4

H5

H6


Case 1

I can fold a heading (and everything below it) by pressing its corresponding number.

  • In the first case, if I want to fold everything up to H2, I press 2.
  • In the second case, if I want to fold everything up to H5, I press 5.

What if we focused not on the actual headings, but the number of levels used?


Case 2

I can fold a level (and everything below it) by pressing its corresponding number. In the two cases, six headings are used, but only three levels.

  • In the first case, if I want to fold everything up to level 2, I press 2.
  • In the second case, if I want to fold everything up to level 2, I press 2.

Notice the difference?


Advantages of the second case:

  • It doesn’t matter what headings are used.
  • You don’t need to recognize which heading is which, like in the first case, which might be hard to do at a glance.
  • The levels are clearly displayed in the Outline, which would serve as a kind of map for folding purposes.