2

When cycling visibility of a subtree using TAB, subtrees will open increasingly showing more subheadings, one at a time. However, when I cycle a buffer globally using S-TAB, their contents are shown, which feels like the wrong thing to do.

This is my tree:

* heading 1
** subheading 1.1
*** subheading 1.1.1
*** subheading 1.1.2
** subheading 1.2
* heading 2
** subheading 2.1
*** subheading 2.1.1
* heading 3

When all collapsed, they look like this:

* heading 1
* heading 2
* heading 3

When I do S-TAB they all open to their most inner subheading:

* heading 1
** subheading 1.1
*** subheading 1.1.1
*** subheading 1.1.2
** subheading 1.2
* heading 2
** subheading 2.1
*** subheading 2.1.1
* heading 3

I would want first to show the immediate level, like this, before showing all the sub-subheadings.

* heading 1
** subheading 1.1
** subheading 1.2
* heading 2
** subheading 2.1
* heading 3

Any way to do this?

Thank you, EG

4
  • 1
    The docstring of the function invoked with Shift-Tab org-shifttab says When ARG is a numeric prefix, show contents of this level. So if you do C-u 2 S-TAB it shows up to level 2 headings. Is that good enough? Or do you want to modify the behavior of the function? There is also org-overview (show top-level headings) and org-content (show all headings without content, it's possible to use C-u 2 M-x org-content as well).
    – Hubisan
    May 12 '20 at 6:50
  • Thanks, I did not know of that prefixed behaviour. Thank you! Question #1: I understand that org-content would be equal to doing C-u (highest number) S-TAB. Question #2: C-u 2 M-x org-content is equal to C-u 2 S-TAB?. Thank you May 13 '20 at 5:08
  • I would also like something like this, so that S-TAB cycles "one step" at a time: -> TOP LEVEL HEADINGS -> SECOND LEVELS -> THIRD LEVELS -> … -> SHOW ALL
    – trmdttr
    Mar 30 at 20:10
  • Actually, S-TAB does not show second levels only, it shows directly org-overview, which means, all top-level headings. Mar 31 at 22:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.