Next: , Previous: Headlines, Up: Document structure


2.3 Visibility cycling

Outlines make it possible to hide parts of the text in the buffer. Org-mode uses just two commands, bound to <TAB> and S-<TAB> to change the visibility in the buffer.

<TAB>
Subtree cycling: Rotate current subtree between the states
          ,-> FOLDED -> CHILDREN -> SUBTREE --.
          '-----------------------------------'
     

The cursor must be on a headline for this to work1. When the cursor is at the beginning of the buffer and the first line is not a headline, then <TAB> actually runs global cycling (see below)2. Also when called with a prefix argument (C-u <TAB>), global cycling is invoked.


S-<TAB>
C-u <TAB>
Global cycling: Rotate the entire buffer between the states
          ,-> OVERVIEW -> CONTENTS -> SHOW ALL --.
          '--------------------------------------'
     

When S-<TAB> is called with a numerical prefix N, the CONTENTS view up to headlines of level N will be shown. Note that inside tables, S-<TAB> jumps to the previous field.


C-c C-a
Show all.
C-c C-r
Reveal context around point, showing the current entry, the following heading and the hierarchy above. Useful for working near a location exposed by a sparse tree command (see Sparse trees) or an agenda command (see Agenda commands). With prefix arg show, on each level, all sibling headings.
C-c C-x b
Show the current subtree in an indirect buffer3. With numerical prefix ARG, go up to this level and then take that tree. If ARG is negative, go up that many levels. With C-u prefix, do not remove the previously used indirect buffer.

When Emacs first visits an Org-mode file, the global state is set to OVERVIEW, i.e. only the top level headlines are visible. This can be configured through the variable org-startup-folded, or on a per-file basis by adding one of the following lines anywhere in the buffer:

     #+STARTUP: overview
     #+STARTUP: content
     #+STARTUP: showall

Footnotes

[1] see, however, the option org-cycle-emulate-tab.

[2] see the option org-cycle-global-at-bob.

[3] The indirect buffer (see Indirect Buffers) will contain the entire buffer, but will be narrowed to the current tree. Editing the indirect buffer will also change the original buffer, but without affecting visibility in that buffer.