diff options
author | David Adam <zanchey@ucc.gu.uwa.edu.au> | 2014-10-17 10:23:05 +0800 |
---|---|---|
committer | David Adam <zanchey@ucc.gu.uwa.edu.au> | 2014-10-17 10:23:05 +0800 |
commit | 4aa38db56f6e138ea9bc15cb6f4ffc3502c3f435 (patch) | |
tree | 3ae7cef52e3b2000631c46cf74fea17376527689 /share/functions/ls.fish | |
parent | 9e32b330aaceb11f9237870f51e5c265990f8215 (diff) |
ls: find and use various dircolors initialisation files, if they exist
Closes #1758.
Diffstat (limited to 'share/functions/ls.fish')
-rw-r--r-- | share/functions/ls.fish | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/share/functions/ls.fish b/share/functions/ls.fish index 4824e1c1..ec25fdfc 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 |