The TaskPaper > Outline
menu of the TaskPaper 3 plain text outliner gives us a rich set of keystrokes for either expanding or collapsing all or part of TaskPaper outlines to some degree.
For some reason (perhaps just laziness) I like to cycle all the things, rather than using one key for collapse and another for expand.
Here is a macro,
Subtree visibility cycling for TaskPaper3.kmmacros (23.2 KB)
which you can attach to a single key (I happen to use ⌘L) for cycling selected outline items between three states:
Fully collapsed -> all children visible -> all descendants visible (-> fully collapsed again)
Or, as it is described in the manual of emacs OrgMode, which also uses this pattern:
,-> FOLDED -> CHILDREN -> SUBTREE --.
'-----------------------------------'
https://orgmode.org/guide/Visibility-cycling.html
JS source at: