How to export all my Intellij code styles to a .editorconfig file?

本秂侑毒 提交于 2019-11-30 11:08:20
Pytry

Go to "File->Settings->Editor->Code Style". At the bottom of the right pane there is a section for Editor Config options, which now includes an "Export" button. This will only export formatting options that are available in the Editor Config specification.

To include advanced options from IDEA you will have to save IntelliJ specific files with the project.

If you want to do this without saving the entire ".idea" folder and "*.iml" files, you can also export the IDEA configuration to an xml file and save in a place where everyone can get to it.

  1. In "File->Settings->Editor->Code Style". At the top of the right pane, there will be a "Scheme" field with an dropdown of options.
  2. Next to the dropdown is a cog/gear image that will expand to give some options depending on which scheme you have selected.
  3. The two options you need are the "Export..." option and the "Import Scheme" options which do what their names imply.

Don't think IntelliJ will do this for you.

You'll probably have to Export IntelliJ's Code Styles as a "Code Style XML File" and then manually parse that to your EditorConfig file. Or find a parser on the internet.

To export all your Code Styles from IntelliJ:

  1. Hit "Ctrl + Alt + S".
  2. Editor > Code Style.
  3. Click the "Manage" button next to where IntelliJ states your Scheme.
  4. Export > Export as Code Style XML File.

HTH

In newer versions @Pytrys solution does not work anymore. Now you have to do it with File -> New -> EditorConfig file:

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!