Fold code in Textmode on Mac

You can fold a block of lines so that only its first line is shown, then unfold it to see the rest. Folding changes what you see, not the text of the document.

Fold and unfold a block

  1. Go to the Textmode app on your Mac.

  2. Do one of the following:

    • Click the chevron to the right of the line number on the first line of a block. If line numbers are hidden, choose View > Show Line Numbers first.

    • Place the insertion point in a block, then choose View > Code Folding > Fold, or press Option-Command-[.

A line that opens a block has a chevron pointing down. When the block is folded, the chevron points right, and a placeholder with three dots follows the first line.

The Fold command folds the block that starts on the line with the insertion point, or else the innermost block around it. Choose it again to fold the block that contains that one.

To unfold a block, do one of the following:

Fold or unfold everything

How Textmode finds blocks

What counts as a block depends on the syntax of the document.

In the languages listed above, except CSS, HTML, LaTeX, and Makefile, two or more lines in a row that hold only a line comment also fold as one block from the first of them. A blank line or a line of code ends the run.

A language embedded in another folds by its own structure: for example, a JavaScript function inside a script element or a CSS rule inside a style element in an HTML document.

What to keep in mind

See also