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

With later Intellijs (I'm using 2020.1), the configuration export is available via Settings -> Editor -> Code Style and then the gear icon. See the screenshot below, and the selected menu options:

enter image description here


Go to "File->Settings (Preferences in OS X)->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.

above steps in image format

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.

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