Source Code Editors

Table of Contents

EditorConfig

EditorConfig helps maintain consistent coding styles for multiple developers working on the same project across various editors and IDEs.

# EditorConfig is awesome: https://EditorConfig.org

# Must be specified in the preamble.
# Set to true to stop the .editorconfig file search on the current file.
# The value is case insensitive.
root = true

# Unix-style newlines with a newline ending every file
[*]
# Set to latin1, utf-8, utf-8-bom, utf-16be or utf-16le to control the character set.
# Use of utf-8-bom is discouraged.
charset = utf-8

# Set to lf, cr, or crlf to control how line breaks are represented.
# The values are case insensitive.
end_of_line = lf

# Set to tab or space to use hard tabs or soft tabs respectively.
# The values are case insensitive.
indent_style = space

# Set to a whole number defining the number of columns used for each indentation level
# and the width of soft tabs (when supported).
# If this equals tab, the indent_size shall be set to the tab size,
# which should be tab_width (if specified); else, the tab size set by the editor.
# The values are case insensitive.
#indent_size = 2

# Set to a whole number defining the number of columns used to represent a tab character.
# This defaults to the value of indent_size and should not usually need to be specified.
#tab_width = 4

# Set to true to remove all whitespace characters
# preceding newline characters in the file and false to ensure it doesn't.
#trim_trailing_whitespace = true

# Set to true ensure file ends with a newline when saving and false to ensure it doesn't.
insert_final_newline = true

# Matches multiple files with brace expansion notation
[*.txt]
end_of_line = crlf

[*.md]
indent_size = 4
trim_trailing_whitespace = false

[*.{htm, html}]
indent_size = 2
trim_trailing_whitespace = true

[*.{css, sass, scss, less}]
indent_size = 2
trim_trailing_whitespace = true

[*.{js, jsx, ts, tsx, vue}]
indent_size = 2
trim_trailing_whitespace = true

[*.{json, xml}]
indent_size = 4
trim_trailing_whitespace = true

[*.{php, py}]
indent_size = 4
trim_trailing_whitespace = true

[*.{yml, yaml}]
indent_size = 2
trim_trailing_whitespace = true