未设置 root=true 时会继续向上查找项目外的 .editorconfig 文件;部分属性仅在保存文件时生效;用户设置 files.trimTrailingWhitespace 为 true 时 trim_trailing_whitespace=false 不生效
editorconfig-vscode
editorconfigMIT更新放缓在 VS Code 里自动读取并应用 .editorconfig 配置,统一不同编辑器和团队成员间的缩进、换行、编码等代码风格。
EditorConfig extension for Visual Studio Code
在 VS Code 扩展市场安装 editorconfig.editorconfigREADME 未说明
VS Code 的 EditorConfig 扩展,用 .editorconfig 文件统一项目编码风格
在 VS Code 里自动读取并应用 .editorconfig 配置,统一不同编辑器和团队成员间的缩进、换行、编码等代码风格。
核心能力
- 读取 .editorconfig 覆盖用户和工作区设置
- 支持 indent_style、indent_size、tab_width 等缩进属性
- 保存时应用 end_of_line、insert_final_newline、trim_trailing_whitespace
- 支持 charset 字符集设置
- 右键菜单可生成 .editorconfig 文件
容易踩的坑
- v0.18.2最新正式版2026-04-08 · 2026-04-08 13:15 UTC
What's Changed
- fix: disable inline comments highlighting in .editorconfig files by @DecimalTurn in https://github.com/editorconfig/editorconfig-vscode/pull/473
- build(deps): bump
editorconfigby @SunsetTechuila in https://github.com/editorconfig/editorconfig-vscode/pull/479
New Contributors
- @DecimalTurn made their first contribution in https://github.com/editorconfig/editorconfig-vscode/pull/473
Full Changelog: https://github.com/editorconfig/editorconfig-vscode/compare/v0.18.1...v0.18.2
- v0.18.12026-01-22 · 2026-01-22 17:56 UTC
查看更新说明
What's Changed
- fix: don't apply
charseton document opening by @SunsetTechuila in https://github.com/editorconfig/editorconfig-vscode/pull/466
Full Changelog: https://github.com/editorconfig/editorconfig-vscode/compare/v0.18.0...v0.18.1
- fix: don't apply
- v0.18.02026-01-21 · 2026-01-21 10:04 UTC
查看更新说明
What's Changed
- chore: simplify extension name by @aaronjheng in https://github.com/editorconfig/editorconfig-vscode/pull/437
- fix: don't set
tabSizewhentab_widthisunsetby @SunsetTechuila in https://github.com/editorconfig/editorconfig-vscode/pull/439 - test(api): properly type scenarios by @SunsetTechuila in https://github.com/editorconfig/editorconfig-vscode/pull/444
- fix(completions): add
tabto list of possible values forindent_sizeby @SunsetTechuila in https://github.com/editorconfig/editorconfig-vscode/pull/445 - build(deps): upgrade by @SunsetTechuila in https://github.com/editorconfig/editorconfig-vscode/pull/446
- chore: fix typos by @noritaka1166 in https://github.com/editorconfig/editorconfig-vscode/pull/447
- refactor: use optional chaining by @noritaka1166 in https://github.com/editorconfig/editorconfig-vscode/pull/448
- feat: support charset by @SunsetTechuila in https://github.com/editorconfig/editorconfig-vscode/pull/442
New Contributors
- @aaronjheng made their first contribution in https://github.com/editorconfig/editorconfig-vscode/pull/437
- @noritaka1166 made their first contribution in https://github.com/editorconfig/editorconfig-vscode/pull/447
Full Changelog: https://github.com/editorconfig/editorconfig-vscode/compare/v0.17.4...v0.18.0
- v0.17.42025-06-02 · 2025-06-02 16:29 UTC
查看更新说明
What's Changed
- fix: merge current editor options into new ones by @SunsetTechuila in https://github.com/editorconfig/editorconfig-vscode/pull/440
Full Changelog: https://github.com/editorconfig/editorconfig-vscode/compare/v0.17.3...v0.17.4
- v0.17.32025-05-31 · 2025-05-31 20:29 UTC
查看更新说明
What's Changed
- build(engines): bump minimum
vscodeversion to 1.98 by @SunsetTechuila in https://github.com/editorconfig/editorconfig-vscode/pull/431 - build(deps-dev): bump undici from 6.21.1 to 6.21.3 in the npm_and_yarn group across 1 directory by @dependabot in https://github.com/editorconfig/editorconfig-vscode/pull/435
- Allow separate tabSize and indentSize by @yshui in https://github.com/editorconfig/editorconfig-vscode/pull/358
New Contributors
- @dependabot made their first contribution in https://github.com/editorconfig/editorconfig-vscode/pull/435
- @yshui made their first contribution in https://github.com/editorconfig/editorconfig-vscode/pull/358
Full Changelog: https://github.com/editorconfig/editorconfig-vscode/compare/v0.17.2...v0.17.3
- build(engines): bump minimum
用户点评
登录用户的真实使用记录,可按版本和硬件筛选还没有人点评。第一个说出真实体验的人最有价值。
EditorConfig for Visual Studio Code
This plugin attempts to override user/workspace settings with
settings found in .editorconfig files. No additional or vscode-specific files
are required. As with any EditorConfig plugin, if root=true is not specified,
EditorConfig will continue to look
for an .editorconfig file outside of the project.
This repository is specific to the EditorConfig Extension for Visual Studio Code. Internally, it uses the editorconfig npm package, which is one of a few EditorConfig cores available.
See also:
Feel free to submit any issues you may have via the issue tracker.
Installation
When identifying an extension, provide the full name of the form
publisher.extension. For this extension, that's editorconfig.editorconfig.
See Extension Marketplace for more information on the multiple ways of installing VSCode extensions.
Supported Properties
indent_styleindent_sizetab_widthend_of_line(on save)insert_final_newline(on save)trim_trailing_whitespace(on save)charset
How it works
This extension is activated whenever you open a new text editor, switch tabs
into an existing one or focus into the editor you already have open. When
activated, it uses editorconfig
to resolve the configuration for that particular file and applies any relevant
editor settings.
Note: some settings can only be applied on file save, as indicated above.
A new .editorconfig file can be created via the Explorer sidebar's context
menu by right-clicking in the folder where you'd like it to be and selecting
Generate .editorconfig.
