-
Notifications
You must be signed in to change notification settings - Fork 103
EditorConfig Properties
Properties are now known as "declarations", but that is only a name change. You should probably always read the latest doc.
This document details current EditorConfig properties and ideas for future properties (both universal and domain-specific).
Universal properties are those which can have a meaning for nearly every file format.
Domain-specific properties are those which may not be meaningful for some file formats.
For any property, a value of unset
is to remove the effect of that property, even if it has been set before. For example, add indent_size = unset
to undefine indent_size
property (and use editor default).
Indentation Style
The values are case insensitive. They will be lowercased by the core library.
Possible Values
tab
space
Supported By
- all plugins
Indentation Size (in single-spaced characters)
The values are case insensitive. They will be lowercased by the core library.
Possible Values
- an integer
tab
If indent_size
equals to tab
, the indent_size
will be set to the tab size, which should be tab_width
if tab_width
is specified, or the tab size set by editor if tab_width
is not specified.
Supported By
- all plugins
Width of a single tabstop character
Possible Values
- a positive integer (defaults
indent_size
whenindent_size
is a number)
Supported By
- all plugins
Line ending file format (Unix, DOS, Mac)
The values are case insensitive. They will be lowercased by the core library.
NOTE: if you want to use native line endings between different operating systems it is better not to set this option and leave that task to the VCS! In the future we might add a value like native
for this scenario (cf #226).
Possible Values
lf
crlf
cr
Supported By
- all plugins
File character encoding (See Character Set Support.)
The values are case insensitive. They will be lowercased by the core library.
Possible Values
latin1
utf-8
utf-16be
utf-16le
utf-8-bom
Denotes whether whitespace is removed from the end of lines
The values are case insensitive. They will be lowercased by the core library.
Possible Values
-
true
: remove any whitespace characters preceding newline characters -
false
: ensure the editor keeps whitespace characters
Denotes whether file should end with a newline
The values are case insensitive. They will be lowercased by the core library.
Possible Values
true
false
Forces hard line wrapping after the amount of characters specified. off
to
turn off this feature (use the editor settings).
Possible Values
- positive integers
off
Supported By
- Emacs
- Vim
- Neovim
- Atom
- ReSharper and Rider
- AppCode, IntelliJ IDEA, PhpStorm, PyCharm, RubyMine, and WebStorm
- Kakoune
- Prettier
Please read the FAQ.
The following properties are not intended to be implemented by EditorConfig.
This is simply a brainstorm of domain-specific properties that could be supported by
some tools that rely on EditorConfig files.
There is a proposal to "namespace" properties with a language-dependent prefix. See Issue #332.
Property | Possible Values | Purpose | Domain |
---|---|---|---|
quote_type |
single , double , auto
|
Denotes preferred quoting style for string literals (for languages that support multiple quote styles) | with multiple equivalent string literal quote types |
c_include_path |
Directory paths separated by colon (: ) |
Denotes the include paths of header files for some languages. Could be used by syntax checkers and compilers inside editors. | C-family languages (such as C, C++, D, Objective-C, etc.) |
java_class_path |
Paths separated by colon (: ) |
Denotes the CLASSPATH used by the Java source files. Could be used by some Java syntax checkers and compilers inside editors. |
Java |
curly_bracket_next_line |
true , false
|
Denotes whether the left part of the curly bracket should be on the next line or not | C-family languages (such as C, C++, Java, Javascript, etc.) |
spaces_around_operators |
true , false , hybrid
|
Denotes whether spaces should be present around arithmetic and boolean operators | with infix operators and optional spaces |
spaces_around_brackets |
none , inside , outside , both
|
Denotes how spaces should be around brackets and parentheses: no space, only inside the brackets, only outside the brackets, or at the both side of brackets | |
indent_brace_style |
K&R , Allman , GNU , Horstmann , etc. |
Denotes the style for using curly braces in code blocks | C-family languages (such as C, C++, Java, Javascript, etc.) with code blocks using curly braces |
wildcard_import_limit |
int | Denotes the number of imports required before multiple imports are automatically collapsed to a wildcard (or a wildcard is automatically expanded to explicit imports) | Java etc. (Eclipse and IDEA already have the core functionality) |
continuation_indent_size |
unsigned integer | Denotes the continuation indent size. Useful to distinguish code blocks versus continuation lines | Python, JetBrains (IntelliJ IDEA), Netbeans (JSON, PHP, Java) |
block_comment, line_comment, block_comment_start, block_comment_end |
char | Denotes the block_comment or line_comment character to mark a block or each line as comment. Some languages require # prepended on each line, others // or ; . Some have specific block start markers and end markers such as /* and */ and <!-- and --!>
|
Python, configfiles, yml, ini, JetBrains (Pycharm, IntelliJ IDEA) |
* Some of the options above are inspired by codepainter.
The wiki is disabled from public edits due to spams. If you would like to request a change in wiki, please open a new discussion.