Intellij idea 如何将.editorconfig应用于intellige中的现有项目

Intellij idea 如何将.editorconfig应用于intellige中的现有项目,intellij-idea,configuration,formatting,Intellij Idea,Configuration,Formatting,我已经为intellij创建了一个.editorconfig文件,如下所示 # editorconfig.org root = true [*] charset = utf-8 insert_final_newline = true trim_trailing_whitespace = true end_of_line = lf indent_style = space indent_size = 4 [*.js] indent_size = 4 [{package.json}] ind

我已经为intellij创建了一个.editorconfig文件,如下所示

# editorconfig.org

root = true

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

[*.js]
indent_size = 4

[{package.json}]
indent_style = space
indent_size = 4
如何一次将此代码样式应用于所有文件正确知道我将打开一个文件并按Ctrl+Alt+l,这将完成此工作有没有方法将其应用为intellij14中所有应用程序的配置只需启用它…;)

(遗憾的是,默认情况下该设置处于禁用状态)

设置>编辑器>代码样式

复选框启用编辑器配置支持


如果在项目初始化后添加了文件

您需要在项目的根目录下添加文件.editorconfig


一旦您对文件配置满意,右键单击并选择synchronize'.editorconfig'

确保按照第一步中的步骤进行操作。如果要将此编辑器配置追溯应用于现有文件,请执行以下操作:

  • 我建议将所有文件提交到git,以便在事情没有按计划进行时可以重置为提交
  • 确保您有一个满意的
    .editorconfig
  • 1:Project
    侧窗格中,右键单击要将
    .editorconfig
    应用到的文件夹(例如,项目的根文件夹)
  • 选择
    重新格式化代码
    ,它具有默认快捷方式ctrlaltL
  • 选择“包含子目录”。其他选项都不需要。然后单击“运行”
您的文件现在遵循
.editorconfig
文件配置


您所指的“synchronize.editorconfig”选项在哪里?