Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

EditorConfig Properties

Hong Xu edited this pageDec 30, 2024 ·78 revisions

Properties are now known as "declarations", but that is only a name change. You should probably always read thelatest doc.

Current and Future EditorConfig Properties

This document details current EditorConfig properties and ideas for future properties (both universal and domain-specific).

Universal vs. 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.

Current Universal Properties

For any property, a value ofunset is to remove the effect of that property, even if it has been set before. For example, addindent_size = unset to undefineindent_size property (and use editor default).

Widely Supported by Editors

indent_style

Indentation Style

The values are case insensitive. They will be lowercased by the core library.

Possible Values

  • tab
  • space

Supported By

  • all plugins

indent_size

Indentation Size (in single-spaced characters)

The values are case insensitive. They will be lowercased by the core library.

Possible Values

  • an integer
  • tab

Ifindent_size equals totab, theindent_size will be set to the tab size, which should betab_width iftab_width is specified, or the tab size set by editor iftab_width is not specified.

Supported By

  • all plugins

tab_width

Width of a single tabstop character

Possible Values

  • a positive integer (defaultsindent_size whenindent_size is a number)

Supported By

  • all plugins

end_of_line

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 likenative for this scenario (cf#226).

Possible Values

  • lf
  • crlf
  • cr

Supported By

  • all plugins

charset

File character encoding (SeeCharacter 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

trim_trailing_whitespace

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

insert_final_newline

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

Supported By A Limited Number of Editors

max_line_length

Forces hard line wrapping after the amount of characters specified.unset toturn off this feature (use the editor settings).

Possible Values

  • positive integers
  • unset

Supported By

  • Emacs
  • Vim
  • Neovim
  • Atom
  • ReSharper and Rider
  • AppCode, IntelliJ IDEA, PhpStorm, PyCharm, RubyMine, and WebStorm
  • Kakoune
  • Prettier

Propose New Properties and Values

Please read theFAQ.

Ideas for Domain-Specific Properties

The following properties are not intended to be implemented by EditorConfig.
This is simply a brainstorm of domain-specific properties that could be supported bysome tools that rely on EditorConfig files.

There is a proposal to "namespace" properties with a language-dependent prefix. SeeIssue #332.

Ideas for Domain-Specific Properties
PropertyPossible ValuesPurposeDomain
quote_typesingle,double,autoDenotes preferred quoting style for string literals (for languages that support multiple quote styles)with multiple equivalent string literal quote types
c_include_pathDirectory 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_pathPaths separated by colon (:)Denotes theCLASSPATH used by the Java source files. Could be used by some Java syntax checkers and compilers inside editors.Java
curly_bracket_next_linetrue,falseDenotes whether the left part of the curly bracket should be on the next line or notC-family languages (such as C, C++, Java, Javascript, etc.)
spaces_around_operatorstrue,false,hybridDenotes whether spaces should be present around arithmetic and boolean operatorswith infix operators and optional spaces
spaces_around_bracketsnone,inside,outside,bothDenotes 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_styleK&R,Allman,GNU,Horstmann, etc.Denotes thestyle for using curly braces in code blocksC-family languages (such as C, C++, Java, Javascript, etc.) with code blocks using curly braces
wildcard_import_limitintDenotes 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_sizeunsigned integerDenotes the continuation indent size. Useful to distinguish code blocks versus continuation linesPython, JetBrains (IntelliJ IDEA), Netbeans (JSON, PHP, Java)
block_comment, line_comment, block_comment_start, block_comment_endcharDenotes 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 bycodepainter.

The wiki is disabled from public edits due to spams. If you would like to request a change in wiki, please open anew discussion.

Clone this wiki locally

[8]ページ先頭

©2009-2025 Movatter.jp