zsh: Use gls instead of ls if available
Alan Pearce alan@alanpearce.co.uk
Sun, 15 Sep 2013 17:51:13 +0100
1 files changed, 12 insertions(+), 6 deletions(-)
jump to
M zsh/zshrc → zsh/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"