Important changes on CotEditor 7.0
Note: This content is based on a prerelease version of CotEditor 7.0.0. Details may change in the final release of CotEditor 7.
CotEditor 7.0.0, released in 2026, introduces a revised syntax definition format. The previous format used YAML files with the .yml extension; the new format uses a package-based file with a dedicated .cotsyntax extension.
All 70 built-in syntaxes have been migrated to this new format. Custom syntaxes created by users are also automatically migrated, so you can start using CotEditor 7 right away without any manual intervention.
However, CotEditor 7 includes not only the format revision but also many feature improvements. To take full advantage of CotEditor 7's capabilities in your custom syntaxes, you may need to adjust your syntax definitions. This page explains the changes to syntax definitions in CotEditor 7 for users who have created custom syntaxes before.
Whole Release Notes for CotEditor 7.0.0
Migration to the new format
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 will be cleared and not carried over to CotEditor 7. Reconfigure them as needed.
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.
Note: During the beta period, migrated syntaxes are stored in a temporary “Syntaxes (Upcoming 7.0)” folder instead. This folder will be removed in the final release, and the migrated syntaxes will be placed directly in the regular Syntaxes folder.
Regular-expression-based and tree-sitter-based parsing
CotEditor 7 uses tree-sitter, a general-purpose parser, for the following 22 of the built-in syntaxes:
- Tree-sitter-supported syntaxes
- C, C#, C++, CSS, Go, HTML, Java, JavaScript, LaTeX, Kotlin, Lua, Makefile, Markdown (outline extraction only), PHP, Python, Ruby, Rust, Scala, Shell Script, SQL, Swift, TypeScript.
All other built-in syntaxes and user-created custom syntaxes continue to use the conventional regular-expression-based parsing method with pattern matching.
Because tree-sitter-based highlighting and outline extraction rules are managed by the app, you cannot customize these features or add tree-sitter support for additional syntaxes. By contrast, regular-expression-based syntaxes allow customization of highlighting rules and outline extraction patterns. In the syntax editor, you can adjust built-in syntaxes or create entirely new syntax definitions from scratch.
Delimiter definitions
CotEditor parses comment and string delimiters (such as "…") using a method separate from regular pattern matching, enabling correct highlighting even in nested situations where a comment-start symbol appears inside a string. CotEditor 7 further strengthens this mechanism by introducing dedicated delimiter definitions, achieving more robust parsing.
These delimiter definitions are also referenced 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 in the syntax editor.
Comment delimiters
Previously, CotEditor allowed only one inline comment delimiter and one block comment delimiter per syntax. CotEditor 7 now lets you add multiple comment delimiters.
New options have also been added: Line Start Only for inline comments, and Nest for block comments. By configuring these options to match the syntax's grammar, you can achieve more robust highlighting.
Indentation
CotEditor has an “Automatically indent while typing” option that adjusts the indentation of the next line when you press Return. Previously, this feature automatically increased the indentation level after specific characters, such as “:” and “{“, regardless of the syntax. In CotEditor 7, you can configure Block Delimiters for indentation, allowing you to set the tokens that change the indentation level on a per-syntax basis.
Removal of implicit delimiter handling
Previously, CotEditor automatically identified delimiter-like definitions from syntax highlighting rules and used them for highlighting. Under the new system, this implicit delimiter extraction is no longer performed. Additionally, CotEditor previously treated “\” (backslash) as an escape character universally across all syntaxes, but this implicit escaping has also been removed. Only escape characters explicitly specified for each string or character delimiter are now used.
Therefore, if you want highlighting that accounts for nested structures of strings, characters, and comment symbols, use the delimiter definitions. Note that during the migration of custom syntaxes to CotEditor 7, definitions that were previously identified as “delimiter-like” are automatically moved to the new delimiter definitions.
Outline extraction
A Kind option has been added to outline extraction rules. Extracted outline items can now display an icon corresponding to their kind, and some item kinds enable collapsible outlines.
Hierarchical outlines
In CotEditor 7, tree-sitter-based syntaxes display hierarchical outlines with collapsible sections in the Outline menu. For regular-expression-based syntaxes, which users can customize, this feature is available only when the outline item's kind is set to Heading with a level. Outline items defined as leveled headings have indentation automatically added by the parser, so you do not need to include indentation in the Display Pattern of your extraction rules.
Removal of outline item style options
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 with a Kind of Container or Mark are automatically displayed in bold.
Regular-expression-based highlighting rules
A new Multiline option has been added to pattern matching rules. When enabled, it allows highlighting of matches that span multiple lines including line breaks. This option is off by default.