all repos — nixfiles @ 52cb39f3cc213cb652e7a22a33614244dbfc25b0

System and user configuration, managed by nix and home-manager

zsh: Use gls instead of ls if available
Alan Pearce alan@alanpearce.co.uk
Sun, 15 Sep 2013 17:51:13 +0100
commit

52cb39f3cc213cb652e7a22a33614244dbfc25b0

parent

75cb3c23b9bc89f9743be6454164c7fe28102bbb

1 files changed, 12 insertions(+), 6 deletions(-)

jump to
M zsh/zshrczsh/zshrc
@@ -264,16 +264,22 @@ alias md='mkdir -p' alias rd='rmdir'
 alias .='source'
 
-alias l="\ls ${ls_options} -Bp"
-alias l1="\ls ${ls_options} -1"
-alias ls="\ls ${ls_options} -hF"
-alias la="\ls ${ls_options} -hA"
-alias ll="\ls ${ls_options} ${ls_isodate} -hl"
+if [[ -n $osx && -n $commands[gls] ]]
+then
+	ls='\gls'
+else
+	ls='\ls'
+fi
+alias l="${ls} ${ls_options} -Bp"
+alias l1="${ls} ${ls_options} -1"
+alias ls="${ls} ${ls_options} -hF"
+alias la="${ls} ${ls_options} -hA"
+alias ll="${ls} ${ls_options} ${ls_isodate} -hl"
 alias lal="ll -A"
 alias lla="lal"
 alias llr="ll -t"
 alias gpp='g++'
-alias lsr="ls -tld *(m-2)" # mtime < -2days
+alias lsr="${ls} -tld *(m-2)" # mtime < -2days
 
 alias trans="transmission-remote transmission.home"
 alias bitcoin="bitcoind"