-
Notifications
You must be signed in to change notification settings - Fork 42
/
index.html
164 lines (123 loc) · 12.8 KB
/
index.html
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
---
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 package.json and .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.</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>
<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/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>
<li><a href="https://github.com/sindresorhus/atom-editorconfig#readme"><img src="logos/atom.png" title="Atom"><span>Atom</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> and 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-binding#readme">Java binding</a> for the Python library.</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 binding 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>Authors and Contributors</h3>
<p>EditorConfig core code and current plugins (unless otherwise stated) were co-created by <a href="http://treyhunner.com">Trey Hunner</a> and <a href="http://www.topbug.net">Hong Xu</a>. Visual Studio plugin was created by <a href="http://www.swansontec.com/">William Swanson</a> and is currently maintained by <a href="http://mpdreamz.nl/">Martijn mn</a>. Sublime Text and Atom plugins were created by <a href="http://sindresorhus.com">Sindre Sorhus</a>. TextMate plugin was created by <a href="http://robbrackett.com/">Rob Brackett</a>. Emacs plugin was created by Trey Hunner and is currently maintained by <a href="http://ecmanaut.blogspot.com/">Johan Sundström</a>. JetBrains plugin was created by <a href="https://github.com/bellkev/">Kevin Bell</a>. EditorConfig logo and illustrations are drawn by <a href="http://squirrelmuffins.com">Kat On</a>, except for the Atom editor logo which was drawn by <a href="http://sindresorhus.com">Sindre Sorhus</a>.
</section>
</section>
</section>