.editorconfig Generator
Create an .editorconfig file for consistent indentation, line endings, charset and whitespace across editors, with overrides for Markdown, YAML, Python, Go, Makefile.
0 = not set
What is .editorconfig Generator?
EditorConfig keeps code style consistent across editors and IDEs (VS Code, JetBrains, Vim, Visual Studio, Sublime…). This tool creates a .editorconfig file with your indentation, line endings, character set and whitespace rules, plus common per-file-type overrides such as tabs for Makefiles and Go or 4 spaces for Python.
How to use .editorconfig Generator
- Choose the Indentation (spaces or tabs) and the Indent size or Tab width.
- Set Line endings, Character set and an optional Max line length.
- Toggle Trim trailing whitespace and Insert final newline, and pick the File-type overrides you need.
- Download
.editorconfigand place it in the root of your project.
Example
Spaces, size 2, LF, UTF-8, trim whitespace, final newline, Markdown and Makefile overrides
# EditorConfig: https://editorconfig.org root = true [*] indent_style = space indent_size = 2 end_of_line = lf charset = utf-8 trim_trailing_whitespace = true insert_final_newline = true [*.md] trim_trailing_whitespace = false [Makefile] indent_style = tab
When to use .editorconfig Generator
Use it in any repository edited by more than one person or editor, especially mixed Windows/macOS/Linux teams where line endings differ. EditorConfig controls basic whitespace only; use a formatter such as Prettier, Black or gofmt for full code style, ideally configured to agree with these settings.
How .editorconfig Generator works
The file starts with root = true so editors stop looking in parent folders, followed by a [*] section with indent_style, indent_size (or tab with tab_width when using tabs), end_of_line, charset, trim_trailing_whitespace and insert_final_newline from the EditorConfig specification. Overrides are added as later glob sections ([*.md], [*.{yml,yaml}], [*.py], [*.go], [Makefile]), which take precedence over [*] for matching files.
Common Use Cases
- Stopping tab-vs-space and CRLF/LF churn in pull requests
- Setting 2-space indentation for a JavaScript project
- Keeping tabs in Makefiles while using spaces elsewhere
- Preserving Markdown line breaks made with trailing spaces
FAQs
Does VS Code support .editorconfig?
Yes, through the official EditorConfig extension. JetBrains IDEs, Visual Studio and GitHub's web editor support it natively.
Why trim_trailing_whitespace = false for Markdown?
In Markdown two trailing spaces create a line break, so trimming them would change the rendered document.
LF or CRLF?
LF is the standard for most repositories, including Windows projects that use Git's autocrlf. Use CRLF only if Windows-only tools require it.