CotEditor 7.0.0, released in 2026, introduces a revised syntax definition format. Previously, syntax definitions were YAML files with the .yml extension. The new format uses package files with a dedicated .cotsyntax extension.
All 70 built-in syntaxes have been migrated to this new format. Custom syntaxes you created in earlier versions are also migrated automatically, so in most cases you can start using CotEditor 7 right away.
At the same time, CotEditor 7 includes more than a format revision. It also brings substantial improvements to syntax parsing. To take full advantage of CotEditor 7 in your custom syntaxes, you may need to adjust your syntax definitions. This page explains the main changes to syntax definition in CotEditor 7 for users who have created custom syntaxes before.
For complete details on the latest syntax definition format, see Define a syntax.
Custom syntaxes created by users are automatically migrated to the new format on the first launch of CotEditor 7. However, any customizations you made to built-in syntaxes are reset and not carried over to CotEditor 7. Reconfigure them as needed.
If you later want to convert a legacy YAML-based syntax definition, you can import it from Format settings. The imported definition is automatically converted to the new format (this compatibility feature is planned to be removed in the future).
Tip: Your previous custom syntaxes are preserved in the “~/Library/Containers/com.coteditor.CotEditor/Data/Library/Application Support/CotEditor/Syntaxes (Legacy, before 7.0)” folder. CotEditor 7 and later no longer use these files, so you can safely delete them if they are no longer needed.
CotEditor 7 uses tree-sitter, a general-purpose parser, for syntax parsing in the following 22 built-in syntaxes:
The remaining built-in syntaxes, as well as user-created custom syntaxes, continue to use the existing regular-expression-based pattern-matching method.
The rules for tree-sitter-based highlighting and outline extraction are managed by the app, so you can’t customize them or add tree-sitter support to additional syntaxes. By contrast, regular-expression-based syntaxes let you customize highlighting rules and outline extraction patterns. In the syntax editor, you can adjust built-in syntaxes or create entirely new ones from scratch.
CotEditor parses comment and string delimiters (such as "…") using a mechanism separate from ordinary pattern matching so that it can still highlight correctly in nested situations, such as when a comment opener appears inside a string. CotEditor 7 strengthens this mechanism by introducing dedicated delimiter definitions for more robust parsing.
These delimiter definitions are used not only for syntax highlighting but also for editor behaviors during text editing, such as the Comment Out command and automatic indentation.
You can edit these definitions in the new Delimiters pane of the syntax editor.
Previously, CotEditor allowed only one inline comment delimiter and one block comment delimiter for each syntax. CotEditor 7 now lets you define multiple comment delimiters.
New options have also been added: Line Start Only for inline comments, and Nest for block comments. Setting these options to match the language grammar helps produce more robust highlighting.
CotEditor has an “Automatically indent while typing” option that adjusts the indentation of the next line when you press Return. Previously, regardless of the syntax, this feature automatically increased the indentation level when a line break followed tokens such as “:” or “{”. In CotEditor 7, you can configure Block Delimiters for indentation to define, for each syntax, which tokens change the indentation level.
Previously, CotEditor automatically identified delimiter-like definitions from syntax highlighting rules and used them for highlighting. In the new system, this implicit delimiter extraction no longer occurs. In addition, CotEditor used to treat “\” (backslash) as an escape character universally across all syntaxes, but this implicit escaping has also been removed. Now only escape characters explicitly specified for each string or character delimiter are used.
Therefore, if you want highlighting that accounts for nested structures of strings, characters, and comment symbols, use the delimiter definitions. During migration to CotEditor 7, definitions that were previously identified as “delimiter-like” are automatically moved to the new delimiter definitions.
A Kind option has been added to outline extraction rules. Extracted outline items can now display an icon corresponding to their kind, and some kinds also make the outline collapsible.
In CotEditor 7, tree-sitter-based syntaxes can show hierarchical outlines with collapsible sections in the Outline menu. For customizable regular-expression-based syntaxes, this feature is available only when the outline item’s Kind is a leveled Heading. The parser automatically adds indentation to outline items defined as leveled headings, so you do not need to include indentation in the Display Pattern of your extraction rules.
Previously, CotEditor allowed you to set display styles such as bold and underline for individual outline items. This feature has been removed in CotEditor 7. Only items whose Kind is Container or Mark are shown in bold automatically.
A new Multiline option has been added to pattern matching rules. When enabled, it allows highlights to span multiple lines, including line breaks. This option is off by default.