The Outline feature in CotEditor lets you quickly navigate a document by listing its structural elements. You can define outline extraction rules that determine which parts of text appear in the Outline menu and how they are displayed.
To define the rules to extract the outline for a syntax, select Outline from the list on the left of the syntax editor, then add conditions to the list on the right side. See Define a syntax for how to open the syntax editor.
The options for the Outline settings are as follows:
| Field | Description |
|---|---|
| Regular Expression Pattern | The strings in the document matched by the regular expressions you set here appear in the outline menu. This setting is required to search the items to be listed. |
| IC | If selected, the case is ignored for searching. For example, the expression “abc” matches “ABC” or “abc” or “Abc” in your document (IC stands for Ignore Case). |
| Title Pattern | Here, you can format the titles of the Outline items. Both the Regular Expression Pattern setting and the setting here determine how the corresponding item is titled in the list. You can also make them bold, italic, or underlined. |
The metacharacters you can use in the Title Pattern are as follows:
| Metacharacter | Description |
|---|---|
| (blank) | The whole string matched by your regular expression pattern. |
$0 | The whole string matched by your regular expression pattern. |
$1 ... $9 | The string matched by the first through ninth parenthesized subexpression in your regular expression pattern. |
- | A separator of the menu (invalid when other letters than “-” are included). |
To show a metacharacter such as “$0” in the menu, you need to put a backslash (\) in front of it. You won’t see that backslash (\) in the menu.