Add an EditorConfig file to provide consistent style across editors. (#579)

diff --git a/.editorconfig b/.editorconfig
new file mode 100644
index 0000000..17ed3c1
--- /dev/null
+++ b/.editorconfig
@@ -0,0 +1,40 @@
+# http://editorconfig.org
+# Consistent coding style across different editors.
+
+# Top-most file
+root = true
+
+# Global styles:
+#   - indent 2 spaces
+#   - add final new line
+#   - trim trailing whitespace
+[*]
+charset = utf-8
+end_of_line = lf
+indent_size = 2
+indent_style = space
+insert_final_newline = true
+trim_trailing_whitespace = true
+
+# BUILD:
+#   - indent 4 spaces
+[BUILD]
+indent_size = 4
+
+# Makefile:
+#   - indent 1 tab
+[Makefile]
+indent_size = tab
+indent_style = tab
+
+# Markdown:
+#   - indent 4 spaces
+#   - trailing whitespace is significant
+[*.md]
+indent_size = 4
+trim_trailing_whitespace = false
+
+# Python
+#   - indent 4 spaces
+[*.py]
+indent_size = 4