-
Notifications
You must be signed in to change notification settings - Fork 46
Expand file tree
/
Copy pathindex.html
More file actions
231 lines (183 loc) · 15.2 KB
/
index.html
File metadata and controls
231 lines (183 loc) · 15.2 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
---
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
# 4 space indentation
[*.py]
indent_style = space
indent_size = 4
# Tab indentation (no size specified)
[*.js]
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="http://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="http://docs.python.org/2/library/configparser.html">Python ConfigParser Library</a>, but [ and ] are allowed in the section names. The section names are filepath <a href="http://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 (/) are used as path separators and octothorpes (#) or semicolons (;) are used for comments. Comments should go on their own lines. EditorConfig files should be UTF-8 encoded, with either CRLF or LF 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>
</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>indent_style</dfn>: set to <q>tab</q> or <q>space</q> to use hard tabs or soft tabs respectively.</li>
<li><dfn>indent_size</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>tab_width</strong> (if specified) will be used.</li>
<li><dfn>tab_width</dfn>: a whole number defining the number of columns used to represent a tab character. This defaults to the value of <strong>indent_size</strong> and doesn't usually need to be specified.</li>
<li><dfn>end_of_line</dfn>: set to <q>lf</q>, <q>cr</q>, or <q>crlf</q> to control how line breaks are represented.</li>
<li><dfn>charset</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>trim_trailing_whitespace</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>insert_final_newline</dfn>: set to <q>true</q> ensure file ends with a newline when saving and <q>false</q> to ensure it doesn't.</li>
<li><dfn>root</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>tab_width</strong> need not be specified unless it differs from the value of <strong>indent_size</strong>. Also, when <strong>indent_style</strong> is set to <q>tab</q>, it may be desirable to leave <strong>indent_size</strong> unspecified so readers may view the file using their preferred indentation format. Additionally, if a property is not standardized in your project (<strong>end_of_line</strong> for example), it may be best to leave it blank.</p>
</section>
<section id="demo">
<h3>Try It Out</h3>
<div class="demo">
<div class="demo-section">
<h4>EditorConfig File</h4>
<div class="js-ec-demo-config code-container">
<div><input name="filename" value="/someproject/.editorconfig" spellcheck="false"></div>
<div>
<textarea name="file" spellcheck="false">[*]
trim_trailing_whitespace = true
insert_final_newline = true
[*.{css,html,js}]
indent_style = space
indent_size = 2
[*.py]
indent_style = space
indent_size = 4
</textarea>
</div>
</div>
</div>
<div class="js-ec-demo-output demo-section">
<h4>Enforced Style for a Given File</h4>
<div class="code-container">
<div><input name="filename" value="/someproject/index.html" spellcheck="false"></div>
<div><pre class="properties"></pre></div>
</div>
</div>
</div>
</section>
</section>
<section id="download">
<h2>Download a Plugin</h2>
<ul class="editor-logos">
<li><a href="https://github.com/editorconfig/editorconfig-jetbrains#readme"><img src="logos/appCode.png" title="AppCode"><span>AppCode</span></a></li>
<li><a href="https://github.com/sindresorhus/atom-editorconfig#readme"><img src="logos/atom.png" title="Atom"><span>Atom</span></a></li>
<li><a href="https://github.com/kidwm/brackets-editorconfig/"><img src="logos/brackets.png" title="Brackets"><span>Brackets</span></a></li>
<li><a href="https://github.com/editorconfig/editorconfig-codeblocks#readme"><img src="logos/codeblocks.png" title="Code::Block"><span>Code::Block</a></li>
<li><a href="https://github.com/editorconfig/editorconfig-emacs#readme"><img src="logos/emacs.png" title="Emacs"><span>Emacs</span></a></li>
<li><a href="https://github.com/editorconfig/editorconfig-geany#readme"><img src="logos/geany.png" title="Geany"><span>Geany</span></a></li>
<li><a href="https://github.com/editorconfig/editorconfig-gedit#readme"><img src="logos/gedit.png" title="Gedit"><span>Gedit</span></a></li>
<li><a href="https://github.com/editorconfig/editorconfig-jetbrains#readme"><img src="logos/intellijIDEA.png" title="intelliJ"><span>intelliJ</span></a></li>
<li><a href="https://github.com/editorconfig/editorconfig-jedit#readme"><img src="logos/jedit.png" title="jEdit"><span>jEdit</span></a></li>
<li><a href="https://github.com/editorconfig/editorconfig-notepad-plus-plus#readme"><img src="logos/notepad.png" title="Notepad++"><span>Notepad++</span></a></li>
<li><a href="https://github.com/editorconfig/editorconfig-jetbrains#readme"><img src="logos/phpStorm.png" title="PHPStorm"><span>PHPStorm</span></a></li>
<li><a href="https://github.com/editorconfig/editorconfig-jetbrains#readme"><img src="logos/pyCharm.png" title="PyCharm"><span>PyCharm</span></a></li>
<li><a href="https://github.com/editorconfig/editorconfig-jetbrains#readme"><img src="logos/rubyMine.png" title="RubyMine"><span>RubyMine</span></a></li>
<li><a href="https://github.com/sindresorhus/editorconfig-sublime#readme"><img src="logos/sublimetext.png" title="Sublime Text"><span>Sublime Text</span></a></li>
<li><a href="https://github.com/Mr0grog/editorconfig-textmate#readme"><img src="logos/textmate.png" title="TextMate"><span>TextMate</span></a></li>
<li><a href="https://github.com/editorconfig/editorconfig-vim#readme"><img src="logos/vim.png" title="Vim"><span>Vim</span></a></li>
<li><a href="https://github.com/editorconfig/editorconfig-visualstudio#readme"><img src="logos/visualstudio.png" title="Visual Studio"><span>Visual Studio</span></a></li>
<li><a href="https://github.com/editorconfig/editorconfig-jetbrains#readme"><img src="logos/webStorm.png" title="WebStorm"><span>WebStorm</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. 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>, and a <a href="https://github.com/editorconfig/editorconfig-core-java#readme">Java library</a>. (there is also a <a href="https://github.com/editorconfig/editorconfig-core-java-binding#readme">Java binding</a> for the Python library. It is only for archive purpose only and is obsoleted.)</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:
<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>
</ul>
</p>
<p>
Editor Plugins:
<ul>
<li>Atom plugin: <a href="http://sindresorhus.com">Sindre Sorhus</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>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>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://mpdreamz.nl">Martijn Laarman</a>, <a href="http://kinddragon.blogspot.com">Arkadiy Shapkin</a></li>
</ul>
</p>
<p>
Logo 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>.
</p>
</section>
</section>
</section>