浏览代码

lib: enable diff color (#8807)

Monson Shao 4 年之前
父节点
当前提交
62648d71bb
共有 1 个文件被更改,包括 5 次插入0 次删除
  1. 5 0
      lib/theme-and-appearance.zsh

+ 5 - 0
lib/theme-and-appearance.zsh

@@ -39,6 +39,11 @@ if [[ "$DISABLE_LS_COLORS" != "true" ]]; then
   fi
 fi
 
+# enable diff color if possible.
+if diff --color . . &>/dev/null; then
+  alias diff='diff --color'
+fi
+
 setopt auto_cd
 setopt multios
 setopt prompt_subst