I have created a .editorconfig
file as shown below for intellij
# 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 go? Right now I will open a file and press Ctrl +Alt +l which will do the job for that file, but is there a way to apply this as the config for all the application in intellij14 ?
To use EditorConfig, make sure the EditorConfig plugin is enabled in the settings. Press Ctrl+Alt+S to open the IDE settings and select Plugins. Click the Installed tab. In the search field, type EditorConfig.
Import a scheme Out of the box, IntelliJ IDEA allows you to import settings in the IntelliJ IDEA code style XML or Eclipse XML Profile format. Press Ctrl+Alt+S to open the IDE settings and select Editor | Code Style. and select Import Scheme. Then select the necessary format.
just enable it... ;)
(unfortunately the setting is off by default)
Settings > Editor > Code Style
checkbox Enable EditorConfig support
Make sure to follow the steps in Michal's answer first. If you want to retroactively apply this editorconfig to your existing files, do the following:
.editorconfig
you are happy with.1:Project
sidepane, right click on the folder you want to apply the .editorconfig
to (e.g. the root folder of your project)Reformat Code
, which has the default shortcut ctrlaltL.Your files now follow your .editorconfig
file configuration.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With