-
Notifications
You must be signed in to change notification settings - Fork 1.3k
/
ls.fish
29 lines (24 loc) · 785 Bytes
/
ls.fish
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#
# Make ls use colors if we are on a system that supports this
#
function ls --description "List contents of directory"
# install LS_COLORS if it hasn't been already. do it now instead of shell init cuz it costs 20ms.
if not test -n "$LS_COLORS"
eval (gdircolors -c ~/.dircolors)
end
# previously had this set to...
# set -l param --color=always # afaik, this isn't neccessary: set --export CLICOLOR_FORCE 1
set -l param --color=auto;
set param $param --almost-all
set param $param --human-readable
set param $param --sort=extension
set param $param --group-directories-first
if isatty 1
set param $param --indicator-style=classify
end
if type gls 1>/dev/null 2>/dev/null
gls $param $argv
else
command ls $param $argv
end
end