Outline mode provides several commands for temporarily hiding or revealing parts of the buffer, based on the outline structure. These commands are not undoable; their effects are simply not recorded by the undo mechanism, so you can undo right past them (see Undo).
Many of these commands act on the current heading line. If point is on a heading line, that is the current heading line; if point is on a body line, the current heading line is the nearest preceding header line.
Make the current heading line’s body invisible (
Make the current heading line’s body visible (
Make everything under the current heading invisible, not including the
heading itself (
Make everything under the current heading visible, including body,
subheadings, and their bodies (
Make the body of the current heading line, and of all its subheadings,
Make all subheadings of the current heading line, at all levels,
Make immediate subheadings (one level down) of the current heading
line visible (
Make all body lines in the buffer invisible (
Make all lines in the buffer visible (
Hide everything except the top n levels of heading lines
Hide everything except for the heading or body that point is in, plus
the headings leading up from there to the top level of the outline
The simplest of these commands are C-c C-c
hide-entry), which hides the body lines directly following the
current heading line, and C-c C-e (
reveals them. Subheadings and their bodies are not affected.
The commands C-c C-d (
hide-subtree) and C-c C-s
show-subtree) are more powerful. They apply to the current
heading line’s subtree: its body, all of its subheadings, both
direct and indirect, and all of their bodies.
The command C-c C-l (
hide-leaves) hides the body of the
current heading line as well as all the bodies in its subtree; the
subheadings themselves are left visible. The command C-c C-k
show-branches) reveals the subheadings, if they had previously
been hidden (e.g., by C-c C-d). The command C-c C-i
show-children) is a weaker version of this; it reveals just
the direct subheadings, i.e., those one level down.
The command C-c C-o (
hide-other) hides everything
except the entry that point is in, plus its parents (the headers
leading up from there to top level in the outline) and the top level
The remaining commands affect the whole buffer. C-c C-t
hide-body) makes all body lines invisible, so that you see
just the outline structure (as a special exception, it will not hide
lines at the top of the file, preceding the first header line, even
though these are technically body lines). C-c C-a
show-all) makes all lines visible. C-c C-q
hide-sublevels) hides all but the top level headings; with a
numeric argument n, it hides everything except the top n
levels of heading lines.
When incremental search finds text that is hidden by Outline mode,
it makes that part of the buffer visible. If you exit the search at
that position, the text remains visible. To toggle whether or not
an active incremental search can match hidden text, type M-s i.
To change the default for future searches, customize the option
search-invisible. (This option also affects how
and related functions treat hidden text, see Query Replace.)
You can also automatically make text visible as you navigate in it by
using Reveal mode (M-x reveal-mode), a buffer-local minor mode.