-
Notifications
You must be signed in to change notification settings - Fork 46
Expand file tree
/
Copy pathindex.html
More file actions
239 lines (185 loc) · 18.6 KB
/
index.html
File metadata and controls
239 lines (185 loc) · 18.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
---
layout: default
description: EditorConfig is a file format and collection of text editor plugins for maintaining consistent coding styles between different editors and IDEs.
---
<section>
<h2 id="overview">What is EditorConfig?</h2>
<p>EditorConfig helps developers define and maintain consistent coding styles between different editors and IDEs. The EditorConfig project consists of <strong>a file format</strong> for defining coding styles and a collection of <strong>text editor plugins</strong> 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.</p>
</section>
<section id="file-format">
<h2>What's an EditorConfig file look like?</h2>
<section id="example-file">
<h3>Example file</h3>
<p>Below is an example <code>.editorconfig</code> file setting end-of-line and indentation styles for Python and JavaScript files.</p>
<div class="code-container">
{% highlight ini %}
# EditorConfig is awesome: http://EditorConfig.org
# top-most EditorConfig file
root = true
# Unix-style newlines with a newline ending every file
[*]
end_of_line = lf
insert_final_newline = true
# Matches multiple files with brace expansion notation
# Set default charset
[*.{js,py}]
charset = utf-8
# 4 space indentation
[*.py]
indent_style = space
indent_size = 4
# Tab indentation (no size specified)
[Makefile]
indent_style = tab
# Indentation override for all JS under lib directory
[lib/**.js]
indent_style = space
indent_size = 2
# Matches the exact files either package.json or .travis.yml
[{package.json,.travis.yml}]
indent_style = space
indent_size = 2
{% endhighlight %}
</div>
<p>Check the Wiki for some real-world examples of <a href="https://github.com/editorconfig/editorconfig/wiki/Projects-Using-EditorConfig">projects using EditorConfig files</a>.</p>
</section>
<section id="file-location">
<h3>Where are these files stored?</h3>
<p>When opening a file, EditorConfig plugins look for a file named <code>.editorconfig</code> in the directory of the opened file and in every parent directory. A search for <code>.editorconfig</code> files will stop if the root filepath is reached or an EditorConfig file with <code>root=true</code> is found.
<p>EditorConfig files are read top to bottom and the closest EditorConfig files are read last. Properties from matching EditorConfig sections are applied in the order they were read, so properties in closer files take precedence.</p>
<p><strong>For Windows Users:</strong> To create an <code>.editorconfig</code> file within Windows Explorer, you need to create a file named <code>.editorconfig.</code>, which Windows Explorer will automatically rename to <code>.editorconfig</code>.</p>
</section>
<section id="file-format-details">
<h3>File Format Details</h3>
<p>EditorConfig files use an INI format that is compatible with the format used by <a href="https://docs.python.org/2/library/configparser.html">Python ConfigParser Library</a>, but <code>[</code> and <code>]</code> are allowed in the section names. The section names are filepath <a href="https://en.wikipedia.org/wiki/Glob_(programming)">globs</a>, similar to the format accepted by <a href="http://manpages.ubuntu.com/manpages/intrepid/man5/gitignore.5.html#contenttoc2">gitignore</a>. Forward slashes (<code>/</code>) are used as path separators and octothorpes (<code>#</code>) or semicolons (<code>;</code>) are used for comments. Comments should go on their own lines. EditorConfig files should be UTF-8 encoded, with either <code><abbr title="Carriage Return Line Feed">CRLF</abbr></code> or <code><abbr title="Line Feed">LF</abbr></code> line separators.</p>
<p>Filepath glob patterns and currently-supported EditorConfig properties are explained below.</p>
</section>
<section id="wildcards">
<h4>Wildcard Patterns</h4>
<p>Special characters recognized in section names for wildcard matching:</p>
<table>
<tr><td><code>*</code></td><td>Matches any string of characters, except path separators (<code>/</code>)</td></tr>
<tr><td><code>**</code></td><td>Matches any string of characters</td></tr>
<tr><td><code>?</code></td><td>Matches any single character</td></tr>
<tr><td><code>[name]</code></td><td>Matches any single character in <em>name</em></td></tr>
<tr><td><code>[!name]</code></td><td>Matches any single character not in <em>name</em></td></tr>
<tr><td><code>{s1,s2,s3}</code></td><td>Matches any of the strings given (separated by commas) (<strong>Available since EditorConfig Core 0.11.0</strong>)</td></tr>
<tr><td><code>{num1..num2}</code></td><td>Matches any integer numbers between <em>num1</em> and <em>num2</em>, where num1 and num2 can be either positive or negative</td></tr>
</table>
<p>Special characters can be escaped with a backslash so they won't be interpreted as wildcard patterns.</p>
</section>
<section id="supported-properties">
<h4>Supported Properties</h4>
<p>Note that not all properties are supported by every plugin. The wiki has a <a href="https://github.com/editorconfig/editorconfig/wiki/EditorConfig-Properties">complete list of properties</a>.</p>
<ul class="property-definitions">
<li><dfn><code>indent_style</code></dfn>: set to <q>tab</q> or <q>space</q> to use hard tabs or soft tabs respectively.</li>
<li><dfn><code>indent_size</code></dfn>: a whole number defining the number of columns used for each indentation level and the width of soft tabs (when supported). When set to <q>tab</q>, the value of <strong><code>tab_width</code></strong> (if specified) will be used.</li>
<li><dfn><code>tab_width</code></dfn>: a whole number defining the number of columns used to represent a tab character. This defaults to the value of <strong><code>indent_size</code></strong> and doesn't usually need to be specified.</li>
<li><dfn><code>end_of_line</code></dfn>: set to <q>lf</q>, <q>cr</q>, or <q>crlf</q> to control how line breaks are represented.</li>
<li><dfn><code>charset</code></dfn>: set to <q>latin1</q>, <q>utf-8</q>, <q>utf-8-bom</q>, <q>utf-16be</q> or <q>utf-16le</q> to control the character set. Use of <q>utf-8-bom</q> is discouraged.</li>
<li><dfn><code>trim_trailing_whitespace</code></dfn>: set to <q>true</q> to remove any whitespace characters preceding newline characters and <q>false</q> to ensure it doesn't.</li>
<li><dfn><code>insert_final_newline</code></dfn>: set to <q>true</q> to ensure file ends with a newline when saving and <q>false</q> to ensure it doesn't.</li>
<li><dfn><code>root</code></dfn>: special property that should be specified at the top of the file outside of any sections. Set to <q>true</q> to stop <code>.editorconfig</code> files search on current file.</li>
</ul>
<p>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.</p>
<p>It is acceptable and often preferred to leave certain EditorConfig properties unspecified. For example, <strong><code>tab_width</code></strong> need not be specified unless it differs from the value of <strong><code>indent_size</code></strong>. Also, when <strong><code>indent_style</code></strong> is set to <q>tab</q>, it may be desirable to leave <strong><code>indent_size</code></strong> unspecified so readers may view the file using their preferred indentation width. Additionally, if a property is not standardized in your project (<strong><code>end_of_line</code></strong> for example), it may be best to leave it blank.</p>
</section>
</section>
<section id="download">
<h2>No Plugin Necessary</h2>
<p>These editors come bundled with native support for EditorConfig. Everything should just work.</p>
<ul class="editor-logos">
<li><a href="http://barebones.com/support/technotes/editorconfig.html"><img src="logos/bbedit.png" title="BBEdit"><span>BBEdit</span></a></li>
<li><a href="https://wiki.gnome.org/Apps/Builder/Features#EditorConfig"><img src="logos/gnome-builder.png" alt="GNOME Builder" title="GNOME Builder"><span>GNOME Builder</span></a></li>
<li><a href="https://github.com/JetBrains/intellij-community/tree/master/plugins/editorconfig"><img src="logos/clion.png" alt="CLion logo"><span>CLion</span></a></li>
<li><a href="https://github.com/JetBrains/intellij-community/tree/master/plugins/editorconfig"><img src="logos/intellijIDEA.png" alt="intelliJ logo"><span>intelliJ</span></a></li>
<li><a href="https://github.com/JetBrains/intellij-community/tree/master/plugins/editorconfig"><img src="logos/rubyMine.png" alt="RubyMine logo"><span>RubyMine</span></a></li>
<li><a href="https://github.com/JetBrains/intellij-community/tree/master/plugins/editorconfig"><img src="logos/webStorm.png" alt="WebStorm logo"><span>WebStorm</span></a></li>
</ul>
<div style="clear: both;"></div>
<h2>Tools and Services</h2>
<p>The following tools and services use EditorConfig files for code formatting.</p>
<ul class="editor-logos">
<li><a href="https://github.com/RReverser/github-editorconfig#readme"><img src="logos/github.png" alt="GitHub logo" title="GitHub (code viewer and editor)"><span>GitHub</span></a></li>
<li><a href="https://gogs.io"><img src="logos/gogs.png" alt="Gogs logo"><span>Gogs</span></a></li>
<li><a href="https://www.sourcelair.com/features/editorconfig"><img src="logos/sourcelair.png" alt="SourceLair logo"><span>SourceLair</span></a></li>
<li><a href="https://tortoisegit.org/"><img src="logos/TortoiseGit.png" alt="TortoiseGit logo"><span>TortoiseGit</span></a></li>
</ul>
<div style="clear: both;"></div>
<h2>Download a Plugin</h2>
<p>To use EditorConfig with one of these editors, you will need to install a plugin.</p>
<ul class="editor-logos">
<li><a href="https://plugins.jetbrains.com/plugin/7294"><img src="logos/appCode.png" alt="AppCode logo"><span>AppCode</span></a></li>
<li><a href="https://github.com/sindresorhus/atom-editorconfig#readme"><img src="logos/atom.png" alt="Atom logo"><span>Atom</span></a></li>
<li><a href="https://github.com/kidwm/brackets-editorconfig/"><img src="logos/brackets.png" alt="Brackets logo"><span>Brackets</span></a></li>
<li><a href="https://panic.com/coda/plugins.php#Plugins"><img src="logos/coda.png" alt="Coda logo"><span>Coda</span></a></li>
<li><a href="https://github.com/editorconfig/editorconfig-codeblocks#readme"><img src="logos/codeblocks.png" alt="Code::Block logo"><span>Code::Block</span></a></li>
<li><a href="https://github.com/ncjones/editorconfig-eclipse#readme"><img src="logos/eclipse.png" alt="Eclipse logo"><span>Eclipse</span></a></li>
<li><a href="https://github.com/editorconfig/editorconfig-emacs#readme"><img src="logos/emacs.png" alt="Emacs logo"><span>Emacs</span></a></li>
<li><a href="https://github.com/editorconfig/editorconfig-geany#readme"><img src="logos/geany.png" alt="Geany logo"><span>Geany</span></a></li>
<li><a href="https://github.com/editorconfig/editorconfig-gedit#readme"><img src="logos/gedit.png" alt="Gedit logo"><span>Gedit</span></a></li>
<li><a href="https://github.com/editorconfig/editorconfig-jedit#readme"><img src="logos/jedit.png" alt="jEdit logo"><span>jEdit</span></a></li>
<li><a href="http://komodoide.com/resources/addons/komodo--editorconfig/"><img src="logos/komodo.png" alt="Komodo logo"><span>Komodo</span></a></li>
<li><a href="https://github.com/welovecoding/editorconfig-netbeans#readme"><img src="logos/NetBeans.png" alt="NetBeans logo"><span>NetBeans</span></a></li>
<li><a href="https://github.com/editorconfig/editorconfig-notepad-plus-plus#readme"><img src="logos/notepad.png" alt="Notepad++ logo"><span>Notepad++</span></a></li>
<li><a href="https://plugins.jetbrains.com/plugin/7294"><img src="logos/phpStorm.png" alt="PHPStorm logo"><span>PHPStorm</span></a></li>
<li><a href="https://plugins.jetbrains.com/plugin/7294"><img src="logos/pyCharm.png" alt="PyCharm logo"><span>PyCharm</span></a></li>
<li><a href="https://github.com/sindresorhus/editorconfig-sublime#readme"><img src="logos/sublimetext.png" alt="Sublime Text logo"><span>Sublime Text</span></a></li>
<li><a href="https://github.com/editorconfig/editorconfig-textadept#readme"><img src="logos/textadept.png" alt="Textadept logo"><span>Textadept</span></a></li>
<li><a href="https://github.com/Mr0grog/editorconfig-textmate#readme"><img src="logos/textmate.png" alt="TextMate logo"><span>TextMate</span></a></li>
<li><a href="https://github.com/editorconfig/editorconfig-vim#readme"><img src="logos/vim.png" alt="Vim logo"><span>Vim</span></a></li>
<li><a href="https://github.com/editorconfig/editorconfig-visualstudio#readme"><img src="logos/visualstudio-pro.png" alt="Visual Studio Pro logo"><span>Visual Studio Professional</span></a></li>
<li><a href="https://marketplace.visualstudio.com/items?itemName=EditorConfig.EditorConfig"><img src="logos/visualstudio-code.png" alt="Visual Studio Code logo"><span>Visual Studio Code</span></a></li>
<li><a href="https://github.com/MarcoSero/EditorConfig-Xcode"><img src="logos/xcode.png" alt="Xcode logo"><span>Xcode</span></a></li>
</ul>
<div style="clear: both;"></div>
</section>
<section id="contributing">
<h2>Contributing to EditorConfig</h2>
<section id="feedback">
<h3>Give us your feedback</h3>
<p>This project is greatly in need of feedback from other developers. We want to hear ideas about how to make this project better. Please use the <a href="http://groups.google.com/group/editorconfig">mailing list</a> to send an email to the EditorConfig team and use the <a href="https://github.com/editorconfig/editorconfig/issues">issue tracker</a> to submit bugs (but please take a look at the <a href="https://github.com/editorconfig/editorconfig/wiki/FAQ">FAQ</a> first). Also feel free to <a href="https://twitter.com/#!/EditorConfig">tweet at us</a>.</p>
</section>
<section id="create-a-plugin">
<h3>Create a plugin</h3>
<p>EditorConfig plugins can be developed by using one of the EditorConfig core libraries. The EditorConfig core libraries accept as input the file being edited, find and parse relevant <code>.editorconfig</code> files, and pass back the properties that should be used. Please ignore any unrecognized properties and property values in your editor plugin for future compatibility, since new properties and permitted values will be added in the future. Currently there is a <a href="https://github.com/editorconfig/editorconfig-core-c#readme">C library</a>, a <a href="https://github.com/editorconfig/editorconfig-core-py#readme">Python library</a>, a <a href="https://github.com/editorconfig/editorconfig-core-js#readme">JavaScript library</a>, a <a href="https://github.com/editorconfig/editorconfig-core-java#readme">Java library</a>, a <a href="https://github.com/editorconfig/editorconfig-core-lua#readme">lua library</a>, a <a href="https://github.com/editorconfig/editorconfig-core-net#readme">.NET library</a>, and a <a href="https://github.com/editorconfig/editorconfig-core-ruby">Ruby library</a>.</p>
<p>If you are planning on creating a new plugin, use the <a href="http://groups.google.com/group/editorconfig">mailing list</a> to let us know so we can help out and link to your plugin once it's created. If you plan on using one of the EditorConfig cores as a library or command line interface, the <a href="http://docs.editorconfig.org">C library documentation</a>, <a href="http://pydocs.editorconfig.org">Python library documentation</a> or <a href="http://javadocs.editorconfig.org">Java library documentation</a> may be helpful.</p>
<p>More details can be found on the <a href="https://github.com/editorconfig/editorconfig/wiki/Plugin-How-To">Plugin-How-To wiki page</a>.</p>
</section>
<section id="contributors">
<h3>Main Contributors</h3>
<p>Core libraries:</p>
<ul>
<li>EditorConfig C Core: <a href="http://www.topbug.net">Hong Xu</a> and <a href="http://treyhunner.com">Trey Hunner</a></li>
<li>EditorConfig Java Core: <a href="https://github.com/denofevil">Dennis Ushakov</a></li>
<li>EditorConfig Javascript Core: <a href="http://treyhunner.com">Trey Hunner</a> and <a href="http://jediscode.blogspot.com">Jed Mao</a></li>
<li>EditorConfig Python Core: <a href="http://treyhunner.com">Trey Hunner</a></li>
<li>EditorConfig .NET Core: <a href="http://localghost.io/">Martijn Laarman</a></li>
<li>EditorConfig Ruby Core: <a href="https://github.com/josh">Joshua Peek</a> and <a href="https://github.com/brianmario">Brian Lopez</a></li>
</ul>
<p>Editor Plugins:</p>
<ul>
<li>Atom plugin: <a href="http://sindresorhus.com">Sindre Sorhus</a></li>
<li>Brackets plugin: <a href="http://kidwm.net/">Chen-Heng Chang</a></li>
<li>Code::Blocks plugin: <a href="http://www.topbug.net">Hong Xu</a></li>
<li>Emacs plugin: <a href="http://treyhunner.com">Trey Hunner</a>, <a href="http://ecmanaut.blogspot.com">Johan Sundström</a></li>
<li>Geany plugin: <a href="http://www.topbug.net">Hong Xu</a></li>
<li>Gedit plugin: <a href="http://treyhunner.com">Trey Hunner</a></li>
<li>GitHub Browser extension: <a href="http://rreverser.com">Ingvar Stepanyan</a></li>
<li>JetBrain plugin: <a href="https://github.com/bellkev/">Kevin Bell</a>, <a href="https://github.com/denofevil">Dennis Ushakov</a></li>
<li>jEdit plugin: <a href="http://www.topbug.net">Hong Xu</a></li>
<li>NetBeans plugin: <a href="http://www.bennyn.de/">Benny Neugebauer</a>, <a href="http://beanbelt.blogspot.de/">Michael Koppen</a>, <a href="http://junichi11.com/">Junichi Yamamoto</a></li>
<li>Notepad++ plugin: <a href="http://www.topbug.net">Hong Xu</a></li>
<li>Sublime Text plugin: <a href="http://sindresorhus.com">Sindre Sorhus</a></li>
<li>TextMate plugin: <a href="http://robbrackett.com">Rob Brackett</a></li>
<li>Vim plugin: <a href="http://www.topbug.net">Hong Xu</a>, <a href="http://treyhunner.com">Trey Hunner</a></li>
<li>Visual Studio plugin: <a href="http://www.swansontec.com">William Swanson</a>, <a href="https://github.com/nulltoken">nulltoken</a>,
<a href="http://localghost.io/">Martijn Laarman</a>, <a href="http://kinddragon.blogspot.com">Arkadiy Shapkin</a>,
<a href="http://github.com/chrisdias">Chris Dias</a> (for VS Code)</li>
<li>Xcode plugin: <a href="http://marcosero.com/">Marco Sero</a></li>
</ul>
<p>
EditorConfig logos drawn by <a href="http://squirrelmuffins.com">Kat On</a>. Website by <a href="http://treyhunner.com">Trey Hunner</a> and <a href="http://www.topbug.net">Hong Xu</a>. Please attribute appropriately.
</p>
</section>
</section>