2006-02-08 09:20:05 +00:00
|
|
|
#
|
|
|
|
# Make ls use colors if we are on a system that supports this
|
|
|
|
#
|
|
|
|
|
2006-02-20 13:02:03 +00:00
|
|
|
if command ls --version 1>/dev/null 2>/dev/null
|
2006-02-08 09:20:05 +00:00
|
|
|
# This is GNU ls
|
2006-03-01 16:53:47 +00:00
|
|
|
function ls -d (N_ "List contents of directory")
|
2006-09-19 16:53:17 +00:00
|
|
|
set -l param --color=auto
|
|
|
|
if isatty 1
|
|
|
|
set param $param --indicator-style=classify
|
|
|
|
end
|
2006-10-04 23:55:30 +00:00
|
|
|
command ls $param $argv
|
2006-02-08 09:20:05 +00:00
|
|
|
end
|
2006-02-20 13:02:03 +00:00
|
|
|
|
2006-11-30 15:40:26 +00:00
|
|
|
if not set -q LS_COLORS
|
|
|
|
if type -f dircolors >/dev/null
|
|
|
|
eval (dircolors -c)
|
|
|
|
end
|
2006-02-20 13:02:03 +00:00
|
|
|
end
|
|
|
|
|
2006-02-08 09:20:05 +00:00
|
|
|
else
|
|
|
|
# BSD, OS X and a few more support colors through the -G switch instead
|
2006-08-09 23:11:55 +00:00
|
|
|
if command ls / -G 1>/dev/null 2>/dev/null
|
2006-03-01 16:53:47 +00:00
|
|
|
function ls -d (N_ "List contents of directory")
|
2006-02-08 09:20:05 +00:00
|
|
|
command ls -G $argv
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|