EditorConfig helps developers maintaining consistent coding styles between different editors.
"My Fievel. I thought I would never see you again." -- Papa Mousekewitz
$ apm install editorconfig
Or, Settings โ Install โ Search for editorconfig
See the EditorConfig documentation.
root
indent_style
indent_size
/tab_width
(indent_size
takes precedence overtab_width
)charset
(supported values:latin1
,utf-8
,utf-16be
,utf-16le
)end_of_line
(supported values:lf
,crlf
)trim_trailing_whitespace
(supported values:true
,false
)insert_final_newline
(supported values:true
,false
; Setting this tofalse
strips final newlines)
๐ก Any malformed or missing property is set to
auto
which leaves the control to Atom.
- Applies the above settings from your
.editorconfig
file - Syntax highlights
.editorconfig
files - Ability to generate an
.editorconfig
file based on the current settings - Displays a nifty ๐ญ in the statusBar whose color shows you if editorconfig takes action for tyour current editor-pane
- Clicking on the ๐ญ displays a descriptive summary about the current state of editorconfig
- Recognizes if you save any
.editorconfig
-file and reapplies all settings to all opened editor-panes
root = true
[*]
indent_style = tab
indent_size = 3
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
[*.{json,yml}]
indent_size = 2
[*.md]
trim_trailing_whitespace = false
You can generate an .editorconfig
file based on the current setting by opening the Command Palette and choosing EditorConfig: Generate Config
.
We're sorry to hear you have troubles using atom-editorconfig! However, we are aware of some caveats:
- Why isn't editorconfig applying the indentation character to my files? Editorconfig is not intended to do so, it will apply the indentation-char only to new indentations.
- Why is the
indent_style
completely not working? Your Atom's config setting "Tab Type" might be set either tosoft
orhard
, this unfortunately prevents editorconfig from influencing the indentation style. Set Atom's "Tab Type" toauto
to fix that. - Why is the feature X not working? Sometimes other packages (f.e. like the "whitespace"-package) override the editorconfig-settings. You might try to fix this by deactivating the package in your settings. We try to "warn" you about confirmed interferences caused by other packages. If you face any unknown troubles, please give us a hint.
๐ก You can check how editorconfig affects your current file by clicking the ๐ญ in the statusbar!
We would be happy to hear from you -- please report us any feedback, issues or ideas. Thank you! ๐
MIT ยฉ Sindre Sorhus