With editor modes, you can switch fonts and editing-assistance features together based on the type of document you’re working on. This lets you move smoothly between writing prose and editing code while keeping an editing environment that fits each task.
Modes let you switch the following settings:
Editor fonts:
The font used to view document (standard font or monospaced font)
Editor behavior:
Text substitutions (such as smart quotes and automatic text replacement)
Spell checking
Text completion
Edit and manage modes in Mode settings. For details about what you can configure in a mode and how to add or remove modes, see Change Mode settings.
In CotEditor’s mode settings, you can choose whether each mode uses the standard font or the monospaced font. For more information about how fonts are handled in CotEditor, see Change fonts.
CotEditor automatically switches the editor mode according to the syntax of the open document. This ensures that when you open a document written in a particular language or format, the same mode is always applied.
Modes can be assigned both to syntax kinds and to individual syntaxes. If a syntax-specific mode exists, CotEditor uses it. Otherwise, it uses the mode assigned to that syntax kind. By default, only syntax-kind modes are defined: General for writing and Code for programming. You can customize these default modes in Mode settings.
You can also create a dedicated mode for a specific syntax. For example, the LaTeX syntax belongs to the General kind, but by creating a LaTeX-specific mode, you can use a proportional standard font while turning off smart quotes and other features that might get in the way of writing code.
For more information about syntax, see Analyze document syntax.