From 4aa38db56f6e138ea9bc15cb6f4ffc3502c3f435 Mon Sep 17 00:00:00 2001 From: David Adam Date: Fri, 17 Oct 2014 10:23:05 +0800 Subject: [PATCH] ls: find and use various dircolors initialisation files, if they exist Closes #1758. --- share/functions/ls.fish | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/share/functions/ls.fish b/share/functions/ls.fish index 4824e1c1d..ec25fdfce 100644 --- a/share/functions/ls.fish +++ b/share/functions/ls.fish @@ -14,7 +14,15 @@ if command ls --version 1>/dev/null 2>/dev/null if not set -q LS_COLORS if type -q -f dircolors - eval (dircolors -c | sed 's/>&\/dev\/null$//') + set -l colorfile + for file in ~/.dir_colors ~/.dircolors /etc/DIR_COLORS + if test -f $file + set colorfile $file + break + end + end + echo $colorfile + eval (dircolors -c $colorfile | sed 's/>&\/dev\/null$//') end end