You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The EditorConfig project consists of a file format for defining coding styles and a collection of text editor plugins that enable editors to read the file format and adhere to defined styles.
EditorConfig files are easily readable and they work nicely with version control systems.
15
12
16
-
## editorconfig的配置文件是怎样的?
13
+
The official website of `editorconfig` is [https://editorconfig.org/](https://editorconfig.org/)
17
14
18
-
以下是一个用于设置Python和JavaScript行尾和缩进风格的配置文件。
15
+
## HBuilderX EditorConfig
16
+
17
+
`HBuilderX` directly supports this specification, no need to download plug-ins, it can be used out of the box. If sublime and vscode support this specification, you need to download the plug-in first.
18
+
19
+
## What's an EditorConfig file look like?
20
+
21
+
Below is an example .editorconfig file setting end-of-line and indentation styles for Python and JavaScript files.
19
22
20
23
```
21
24
# EditorConfig is awesome: http://EditorConfig.org
When opening a file, EditorConfig plugins look for a file named `.editorconfig` in the directory of the opened file and in every parent directory. A search for .editorconfig files will stop if the root filepath is reached or an EditorConfig file with `root=true` is found.
EditorConfig files are read top to bottom and the most recent rules found take precedence. Properties from matching EditorConfig sections are applied in the order they were read, so properties in closer files take precedence.
EditorConfig files use an `INI` format that is compatible with the format used by Python ConfigParser Library, but [ and ] are allowed in the section names.
88
+
89
+
The section names are filepath globs (case sensitive), similar to the format accepted by gitignore. Only forward slashes (`/`, not backslashes) are used as path separators and octothorpes (`#`) or semicolons (`;`) are used for comments.
90
+
91
+
Comments should go on their own lines. EditorConfig files should be `UTF-8` encoded, with either `CRLF` or `LF` line separators.
| indent_style | set to tab or space to use hard tabs or soft tabs respectively. |
112
+
| indent_size | a whole number defining the number of columns used for each indentation level and the width of soft tabs (when supported). When set to tab, the value of tab_width (if specified) will be used. |
113
+
| tab_width | a whole number defining the number of columns used to represent a tab character. This defaults to the value of indent_size and doesn't usually need to be specified. |
114
+
| end_of_line | set to lf, cr, or crlf to control how line breaks are represented. |
115
+
|charset |set to latin1, utf-8, utf-8-bom, utf-16be or utf-16le to control the character set. |
116
+
| trim_trailing_whitespace| set to true to remove any whitespace characters preceding newline characters and false to ensure it doesn't. |
117
+
| insert_final_newline | set to true to ensure file ends with a newline when saving and false to ensure it doesn't. |
118
+
| root | special property that should be specified at the top of the file outside of any sections. Set to true to stop .editorconfig files search on current file. |
1.Currently all properties and values are case-insensitive. They are lowercased when parsed. Generally, if a property is not specified, the editor settings will be used, i.e. EditorConfig takes no effect on that part.
123
+
2.It is acceptable and often preferred to leave certain EditorConfig properties unspecified. For example, tab_width need not be specified unless it differs from the value of `indent_size`. Also, when indent_style is set to tab, it may be desirable to leave `indent_size` unspecified so readers may view the file using their preferred indentation width. Additionally, if a property is not standardized in your project (`end_of_line` for example), it may be best to leave it blank.
124
+
3.If you don't need the function of editorconfig, you can turn off this function in [Settings].
0 commit comments