diff --git a/.gitattributes b/.gitattributes
new file mode 100644
index 000000000..4b89e7754
--- /dev/null
+++ b/.gitattributes
@@ -0,0 +1,11 @@
+# Auto detect text files and perform normalization
+*          text=auto
+
+*.rs       text diff=rust
+*.toml     text diff=toml
+
+*.scm      text diff=scheme
+*.md       text diff=markdown
+
+book/theme/highlight.js linguist-vendored
+Cargo.lock text