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.
Go to the Textmode app
on your Mac.
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:
Click its chevron.
Click its placeholder.
Place the insertion point on the folded line, then choose View > Code Folding > Unfold, or press Option-Command-]. Unfold opens every fold that starts on a selected line.
To fold every block in the document, including blocks inside other blocks, choose View > Code Folding > Fold All.
To open every fold, choose View > Code Folding > Unfold All.
What counts as a block depends on the syntax of the document.
By the structure of the language: For C, C#, C++, CSS, Go, HTML, Java, JavaScript, Kotlin, LaTeX, Lua, Makefile, PHP, Python, Ruby, Rust, Scala, Shell Script, SQL, Swift, and TypeScript, blocks follow the language itself, such as the body of a function or a class. The first line of the block stays visible, and so does a closing line such as } or end. Right after you open a document or change its syntax, Textmode uses indentation until it has analyzed the text.
By headings: In a Markdown document, a heading folds everything up to the next heading of the same or a higher level. A heading is a line that starts with #, or a line of text directly above a line made only of = (first level) or only of - (second level). Lines inside a fenced code block are not treated as headings, and neither are the lines of front matter at the top of a document, from a first line of --- to the next line of --- or ....
By indentation: In every other syntax, including Plain Text, a line opens a block when the next line that isn’t blank is indented more deeply. The block ends before the next such line that is indented no deeper than the first line. Blank lines at the end of a block stay outside the fold.
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.
Folds are not saved in the file. When Textmode reopens a window from your last session, the folds in it come back, as long as their lines still form the same blocks by indentation, or by headings in a Markdown document.
When Find or Go to Line selects text inside a fold, the fold opens.
Changing the syntax of a document opens all its folds.
A block written on a single line has nothing to fold, and neither does a single comment line.
Folding is not available while the text orientation is vertical.