How to use the .editorconfig Generator
- Choose a preset close to your project — Web, Node, Python, Go or a Makefile project.
- Adjust the defaults in the
[*]section: indent style and size, line endings, charset, whitespace rules. - Add or edit sections for specific files using globs like
*.md,*.{json,yml}orMakefile. - Download the file into your repository root. VS Code needs the EditorConfig extension; JetBrains IDEs support it out of the box.
EditorConfig properties
| Property | Values | Effect |
|---|---|---|
indent_style | space, tab | Spaces or tabs for indentation |
indent_size | 2, 4, tab | Width of one indentation level |
end_of_line | lf, crlf, cr | Line endings — use lf in most repos |
charset | utf-8, utf-8-bom, latin1… | File encoding |
trim_trailing_whitespace | true, false | Remove spaces at line ends on save |
insert_final_newline | true, false | Ensure files end with a newline |
max_line_length | number, off | Guide/hard wrap in supporting editors |
Why Markdown and Makefiles get their own sections
In Markdown two trailing spaces create a line break, so trim_trailing_whitespace = false for *.md. Makefiles require real tab characters for recipe lines, and Go’s gofmt uses tabs too. Python’s PEP 8 recommends 4 spaces.
EditorConfig vs Prettier
EditorConfig controls how your editor writes files as you type; formatters like Prettier rewrite them on save or in CI. They work together — Prettier even reads .editorconfig for indentation and line endings. Add the file next to your .gitignore and package.json, and format existing code with the JavaScript, CSS or HTML Formatter.
Tools that pair well with the .editorconfig Generator
- GitHub Actions Workflow Generator — Choose your stack, triggers and steps and get a commented .github/workflows/ci.yml — install, cache, lint, test, build, a version matrix and optional deploy to GitHub Pages, Vercel or a container registry.
- Git Command Generator — Pick a task like “undo the last commit but keep my changes” or “rename a branch on GitHub”, fill in your branch names and get the exact Git commands — each line explained, risky steps flagged.
- .env File Validator — Paste a .env file to find invalid keys, duplicates, empty values and quoting mistakes, compare it with .env.example to spot missing variables, and generate a safe example file.
- Semantic Version Calculator — Everything about semantic versions in one place: compare two versions, calculate the next major/minor/patch/prerelease, and see exactly which versions an npm range like ^1.2.0 or ~2.3 allows — explained in plain English.