Export "Detect and use existing file indents for editing" option to .editorconfig file

Completed

Hello, everyone.

 

I want to share indent settings with team throw the .editorconfig file. By default, option Preferences | Editor | Code style – Detect and use existing file indents for editing already setted up and sometimes instead of expected tab I see spaces. So, my question is it possible to export this option to config file?

 

Thanks.

8 comments

Hi,

Have you tried exporting and importing settings (https://www.jetbrains.com/help/pycharm/exporting-and-importing-settings.html)?

You could choose Code style to import.

0

Yes, I did. But this option wasn't exported. There was only settings:

charset
insert_final_newline
indent_style
indent_size

0

Hmm, tried several times and Detect and use existing file indents for editing got exported and imported. What is your PyCharm version?

Is it possible to share this settings file so I can try it? You could upload it to https://uploads.services.jetbrains.com/, just let me know the name of that file.

0

I'm using:

PyCharm 2018.3.2 (Professional Edition)
Build #PY-183.4886.43, built on December 18, 2018
JRE: 1.8.0_152-release-1343-b26 amd64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Windows 10 10.0

default export file:

[*]
charset=utf-8
end_of_line=crlf
insert_final_newline=false
indent_style=space
indent_size=4

[{*.ng,*.sht,*.html,*.shtm,*.shtml,*.htm}]
indent_style=tab
tab_width=4

[{.babelrc,.stylelintrc,jest.config,.eslintrc,*.json,*.jsb3,*.jsb2,*.bowerrc}]
indent_style=space
indent_size=2

[*.css]
indent_style=tab
tab_width=4

[{*.cql,*.ddl,*.sql}]
indent_style=space
indent_size=2

[*.js]
indent_style=tab
tab_width=4

[*.js.map]
indent_style=space
indent_size=2

manually patched file:

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

[{*.js,*.css,*.htm,*.html}]
indent_style=tab
tab_width=4
0

>default export file:

Which file is it?

This setting is stored in Default.xml file under codestyles directory. Note, that you should change it for Default IDE. Please make sure that it is selected and then export your settings. You can then unzip settings.zip and see if Default.xml file has this setting. Then import.

0

> Which file is it?

I'm talking about .editorconfig file.

Your solution is to share Default.xml file between teammembers? Actually, original idea is to have the same code style on the project. As I thought, add .editorconfig to the git is a solution.

0

.editorconfig indeed doesn't have this setting.

>Actually, original idea is to have the same code style on the project.
In such case you could share settings https://www.jetbrains.com/help/pycharm/synchronizing-and-sharing-settings.html.

From article:

"For sharing project settings, .idea project configuration directory should be shared via version control."

If you don't need to synchronise settings and only need to set it up once, then I guess my previous suggestion about export/import of the settings is correct.

1

Question can be marked as resolved.

 

Thank you.

0

Please sign in to leave a comment.