[英]how to apply .editorconfig to existing project in intellij
I have created a .editorconfig
file as shown below for intellij我为
.editorconfig
创建了一个.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
How do i apply this code style to all the files in one shot right know i will open a file and press Ctrl + Alt + l which will do the job is there a way to apply this as the config for all the application in intellij14我如何将这种代码样式应用于一次拍摄中的所有文件,知道我将打开一个文件并按Ctrl + Alt + l这将完成这项工作有没有办法将其应用为 intellij14 中所有应用程序的配置
Make sure to follow the steps in Michal's answer first.确保首先按照Michal 的回答中的步骤进行操作。 If you want to retroactively apply this editorconfig to your existing files, do the following:
如果您想将此 editorconfig 追溯应用到现有文件,请执行以下操作:
.editorconfig
you are happy with..editorconfig
。1:Project
sidepane, right click on the folder you want to apply the .editorconfig
to (eg the root folder of your project)1:Project
侧窗格中,右键单击要应用.editorconfig
的文件夹(例如项目的根文件夹)Reformat Code
, which has the default shortcut ctrl alt L .Reformat Code
,它有默认的快捷键ctrl alt L 。 Your files now follow your .editorconfig
file configuration.您的文件现在遵循您的
.editorconfig
文件配置。
If you added the file after project initialization.如果您在项目初始化后添加了该文件。
You need to add the file .editorconfig on the root of the project.您需要在项目的根目录中添加文件 .editorconfig。
Once happy with you file configuration right click and select synchronize '.editorconfig'对文件配置满意后,右键单击并选择同步“.editorconfig”
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.