Hideshow mode is a buffer-local minor mode that allows you to selectively display portions of a program, which are referred to as blocks. Type M-x hs-minor-mode to toggle this minor mode (see Minor Modes).
When you use Hideshow mode to hide a block, the block disappears from the screen, to be replaced by an ellipsis (three periods in a row). Just what constitutes a block depends on the major mode. In C mode and related modes, blocks are delimited by braces, while in Lisp mode they are delimited by parentheses. Multi-line comments also count as blocks.
Hideshow mode provides the following commands (defined in hs-prefix-map):
Hide the current block (hs-hide-block).
Show the current block (hs-show-block).
Either hide or show the current block (hs-toggle-hiding).
Hide all top-level blocks (hs-hide-all).
Show all blocks in the buffer (hs-show-all).
Hide all blocks n levels below this block
(hs-hide-level).
Cycle the visibility state of the current block (hs-cycle).
Either hide or show all the blocks in the current buffer. (hs-toggle-all).
These variables can be used to customize Hideshow mode:
hs-hide-comments-when-hiding-allIf non-nil, hs-hide-all, hs-cycle and
hs-hide-level hide comments too.
hs-hide-block-behaviorThis variable controls how hs-hide-block and
hs-toggle-hiding should hide a block. The possible values can be
’after-bol’, hide the innermost block to which the current line belongs;
or ’after-cursor’, hide the block after cursor position.
hs-display-lines-hiddenIf non-nil, display the number of hidden lines next to the
ellipsis.
hs-show-indicatorsThis variable controls whether Hideshow mode should display indicators
of hidden and shown blocks. The indicators also allow toggling the
hide/show state of each block. If the value is non-nil, it enables
the indicators. The default is nil, which disables
the indicators.
hs-indicator-typeThis variable controls where to show the indicators, if they are enabled. You can show them on the fringe (see Window Fringes) or in the window’s margin. The default is to use the fringe if it’s available, otherwise to use the margin.
hs-indicator-maximum-buffer-sizeThis variable limits the display of hideshow indicators to buffers that
are not too large. (Larger buffers might adversely affect redisplay
performance.) By default, buffers larger than 2MB have the indicators
disabled; the value of nil will activate the indicators
regardless of the buffer size.
hs-cycle-filterThis variable controls where on the line with hideable blocks typing the
TAB key will cycle the visibility of the blocks. Depending
on its non-nil value, TAB can be active on different parts
of such lines. Anywhere else on the line TAB has its default key
binding. The value nil means TAB cannot cycle the
visibility of the blocks anywhere on the heading line.
hs-isearch-openThis variable specifies the conditions under which incremental search
should unhide a hidden block when matching text occurs within the
block. Its value should be either code (unhide only code
blocks), comment (unhide only comments), t (unhide both
code blocks and comments), or nil (unhide neither code blocks
nor comments). The default value is code.