Editora 0.20.0 docs. You are reading an archived version, kept so links from that release keep working. Read the 0.21.0 docs →

EditorConfig

Editora reads a project’s .editorconfig so your files follow the project’s conventions without per-file fiddling. It’s on by default; toggle it in Settings → Editor → Indentation or with View: Toggle EditorConfig Support.

How resolution works

When you open a file, Editora finds the nearest .editorconfig by walking up the directory tree until it hits a file with root = true. Closer directories win, so a nested config overrides a parent.

Supported keys

KeyEffect
indent_style, indent_size, tab_widthTab and Enter indentation
end_of_lineLF / CRLF / CR, round-tripped on save
charsetutf-8, utf-8-bom, latin1, utf-16le/be, round-tripped on read and save
max_line_lengthDrives the column ruler
trim_trailing_whitespaceTrim on save
insert_final_newlineEnsure a trailing newline on save

The on-save fixups (trim, final newline) and the encoding round-trip apply when the file is written, so what’s on disk matches the config.

When a charset rule makes a save write the file in a different encoding, or adds or removes its byte-order mark, the save message in the status bar says so: it names the old encoding, the new one, and the charset rule that caused the change. It also says when insert_final_newline = false left trailing line breaks out.

Files with mixed line endings

A file that uses more than one kind of line ending (a CRLF file with a few bare LF lines, say) is shown in the status bar as Mixed, with its dominant ending in parentheses: “Mixed (LF)”. This applies with or without an .editorconfig.

  • Saving it without editing it writes the file back byte for byte. Nothing is normalised.
  • Saving an edit writes the dominant ending on every line. The status bar says so, and the bytes the file had before are first copied to line-ending-originals/ in the config folder, which keeps the last 30.
  • If the file also contains binary data, rewriting its line breaks would change that data, so the save asks first (Rewrite and Save).

Without an .editorconfig

The indent unit is normally inferred per file. You can force it with a global Indent style preference (Detect / Spaces / Tabs) in Settings → Editor → Indentation, or the Editor: Set Indent Style… command. With an .editorconfig present, its indent_style takes precedence over the global preference.

The EditorConfig: Open Active File command (editorConfig.openActive, also the status-bar EditorConfig segment) opens the .editorconfig governing the current file.