I am trying to unify my org-mode hotkeys with Workflowy's. In Workflowy, C-↓ and C-↑ will expand and collapse hierarchical structure respectively.

I want to mimic this behavior in org-mode. I know I can bind C-↓ to org-cycle, but I cannot figure out how to reverse the behavior.

What can I do to org-cycle in reverse?


The org-cycle command cycles between different states (folded, show children, show subtree, back to folded) so it isn't quite the same as having separate expand and collapse commands -- you don't need two key bindings since once expanded you can hit tab again to hide everything.

If you want to bind separate expand and collapse commands, you might use org-show-subtree as your expand command, and use outline-hide-subtree for the inverse operation. Note that those operate on the whole subtree so it's a bit different then org-cycle which allows you to show just the children before showing the whole tree. I don't think there are equivalent "partial expand, then full expand" and "partial collapse, then full collapse" commands so you might need to write your own based on org-cycle.

| improve this answer | |

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.