Define a syntax in CotEditor on Mac

Use the syntax editor in CotEditor to customize built-in syntaxes or create your own.

Open the syntax editor

  1. Go to the CotEditor app on your Mac.

  2. Choose CotEditor > Settings, then click Format.

  3. Do any of the following:
    • 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.

Edit a syntax definition

In the syntax editor, you can configure the following aspects of a syntax definition:

Export a custom syntax

  1. Go to the CotEditor app on your Mac.

  2. Choose CotEditor > Settings, then click Format.

  3. Select the syntax to export in the “available syntaxes” list.

  4. Do one of the following:

    • Click the Action button or open the contextual menu for the selected item, then choose Export.

    • Click the Action button 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.

Import a custom syntax

  1. Go to the CotEditor app on your Mac.

  2. Choose CotEditor > Settings, then click Format.

  3. Do one of the following:

    • Click the Action button, 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.

See also