diff --git a/.editorconfig b/.editorconfig
index 1d69c58..a654e89 100644
--- a/.editorconfig
+++ b/.editorconfig
@@ -1,5 +1,12 @@
 root = true
 
+[*]
+charset = utf-8
+end_of_line = lf
+indent_style = tab
+insert_final_newline = true
+trim_trailing_whitespace = true
+
 [*.{php,css,html,xml,lua,js}]
 indent_style = tab
 indent_size = 4
diff --git a/.gitattributes b/.gitattributes
new file mode 100644
index 0000000..425c21f
--- /dev/null
+++ b/.gitattributes
@@ -0,0 +1,16 @@
+# Set the default behavior, in case people don't have core.autocrlf set.
+* text=auto
+
+# Declare files that will always have LF line endings on checkout.
+*.php text eol=lf
+*.lua text eol=lf
+*.html text eol=lf
+*.css text eol=lf
+*.js text eol=lf
+*.xml text eol=lf
+
+*.sql text eol=crlf
+
+# Denote all files that are truly binary and should not be modified.
+*.png binary
+*.jpg binary