aboutsummaryrefslogtreecommitdiffstats
path: root/.functions
diff options
context:
space:
mode:
Diffstat (limited to '.functions')
-rw-r--r--.functions8
1 files changed, 8 insertions, 0 deletions
diff --git a/.functions b/.functions
index 4c7f6e7..67e64d6 100644
--- a/.functions
+++ b/.functions
@@ -3,6 +3,14 @@ function md() {
mkdir -p "$@" && cd "$@"
}
+# Use Git’s colored diff when available
+hash git &>/dev/null
+if [ $? -eq 0 ]; then
+ function diff() {
+ git diff --no-index --color-words "$@"
+ }
+fi
+
# Create a data URL from an image (works for other file types too, if you tweak the Content-Type afterwards)
dataurl() {
echo "data:image/${1##*.};base64,$(openssl base64 -in "$1")" | tr -d '\n'