Say I am in org-mode in a document with the following structure:
* First headline
* Second headline
** Section A
Here is one line
Here is another line
blah, blah
** Section B
Say the cursor is on the line that reads Here is another line. I would like to collapse ** Section A from this location with a keyboard shortcut.
- If I press
<TAB>it does not collapse** Section A, as I would need the cursor to be on the stars for this to work. - If I press
<Shift-TAB>it collapses all outlines, and not the current one.
Is there any way to cycle through the collapsing of the outline in scope (i.e. the “current outline”)?
You can customize the behaviour of the
org-cyclecommand (which is bound to<TAB>) by changing the value oforg-cycle-emulate-tab.To get it to collapse
** Section Awhen your cursor is onHere is another lineadd the following line to your .emacs file:The
whitewill allow you to still use<TAB>to indent in empty lines. From org-mode Github: