.editorconfig Builder

Generate an .editorconfig enforcing consistent coding styles across editors

Build a valid .editorconfig file. Set indent style and size, line endings, charset, trailing-whitespace trimming, final newline and file-type overrides for Makefiles, YAML and Markdown. It runs free in your browser on Gera Tools, with nothing uploaded.

Last updated Source: Gera Tools

What does the root = true line do?

It tells EditorConfig-aware editors to stop searching parent directories for more .editorconfig files. You set it in the top-level file at your repository root so its rules are the final word for the project.

The .editorconfig builder generates a valid EditorConfig file so every contributor’s editor uses the same indentation, line endings and whitespace rules — regardless of personal settings. Choose your base style, add file-type overrides, then copy or download a ready-to-commit file.

Why .editorconfig belongs in every repository

Without a shared editor configuration, developers on different machines and editors silently disagree on tabs versus spaces, CRLF versus LF, and whether files end with a newline. These differences produce noisy diffs, break linters, and occasionally cause runtime errors (GNU Make breaks on space-indented recipes, Python cares about consistent indentation, YAML rejects tabs). A single .editorconfig file at the root of the repository resolves all of this at save time, before a commit even happens.

How it works

EditorConfig files are read top-down. The builder always emits root = true followed by a [*] section that applies to every file: indent_style, indent_size, end_of_line, charset, trim_trailing_whitespace and insert_final_newline. Editors then apply more specific sections on top — so a [*.md] or [Makefile] block overrides the [*] defaults only for matching files. Because later, more specific matches win, you set sane global defaults once and override only where a file type genuinely differs.

File-type overrides and why they matter

Three common overrides ship as toggles:

SectionKey settingReason
[Makefile]indent_style = tabGNU Make requires literal tabs in recipe lines; spaces cause a “missing separator” error
[*.{yml,yaml}]indent_size = 2YAML forbids tab indentation; 2 spaces is the universal YAML convention
[*.md]trim_trailing_whitespace = falseTwo trailing spaces in Markdown create a hard line break; stripping them silently changes rendered output

A minimal generated file

root = true

[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[Makefile]
indent_style = tab

[*.{yml,yaml}]
indent_size = 2

[*.md]
trim_trailing_whitespace = false

Editor support and workflow tips

Most modern editors support EditorConfig natively or via a small plugin:

  • VS Code: built-in, no extension needed
  • JetBrains IDEs (IntelliJ, WebStorm, etc.): built-in
  • Vim/Neovim: editorconfig-vim plugin
  • Emacs: editorconfig-emacs package

If your rules seem to be ignored, check that the extension is installed and that there is no higher-precedence setting overriding it in your user or workspace settings.

Pair .editorconfig (whitespace and encoding) with a formatter like Prettier or gofmt (full code style) for complete, automated consistency across the team. EditorConfig handles the structural rules; the formatter handles the stylistic ones.