Use the syntax editor in CotEditor to customize built-in syntaxes or create your own.
Go to the CotEditor app
on your Mac.
Choose CotEditor > Settings, then click Format.
Customize an existing syntax: Select the syntax you want to customize in the “available syntaxes” list, then double-click the syntax name or click the Edit button.
Define a new syntax: Click the Add button below the “available syntaxes” list.
In the syntax editor, you can configure the following aspects of a syntax definition:
Name: Set the name of the syntax.
Kind: Specify whether the syntax is intended for coding or general-purpose use. This option affects the editor’s font and behavior set in Mode settings.
highlighting elements: Define the rules for syntax highlighting.
Comments: Define comment delimiters and related highlighting rules.
Outline: Define how outline items are extracted and formatted.
Completion: Define completion candidates.
File Mapping: Define what kind of files use this syntax.
Information: Edit metadata for the syntax definition.
Validation: Verify that no grammatical or formatting errors are present in the definition.
Go to the CotEditor app
on your Mac.
Choose CotEditor > Settings, then click Format.
Select the syntax to export in the “available syntaxes” list.
Do one of the following:
Click or open the contextual menu for the selected item, then choose Export.
Click or open the contextual menu for the selected item, choose Share, then choose how to share it.
Drag the selected item into the Finder.
Note: Only custom syntaxes can be exported. Original built-in syntaxes can’t be exported.
Tip: You can export all custom syntaxes at once as a CotEditor Settings Archive. For details, see Export and import settings.
Go to the CotEditor app
on your Mac.
Choose CotEditor > Settings, then click Format.
Do one of the following:
Click , choose Import, then choose a CotEditor syntax file (YAML format) to import.
Drag the CotEditor syntax file (YAML format) into the “available syntaxes” list.
A CotEditor syntax file uses an original YAML-based format with the .yml file extension.