From ca5cc939a19765cb63decc95ca4e42b9316861e9 Mon Sep 17 00:00:00 2001 From: Ian Ker-Seymer Date: Fri, 24 Oct 2014 13:29:07 -0600 Subject: [PATCH] Make ls/ll aliases linux friendly --- zsh/aliases.zsh | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/zsh/aliases.zsh b/zsh/aliases.zsh index bec7bec..43c7846 100644 --- a/zsh/aliases.zsh +++ b/zsh/aliases.zsh @@ -3,6 +3,15 @@ # Don't change. The following determines where YADR is installed. yadr=$HOME/.yadr +# Get operating system +platform='unknown' +unamestr=$(uname) +if [[ $unamestr == 'Linux' ]]; then + platform='linux' +elif [[ $unamestr == 'Darwin' ]]; then + platform='darwin' +fi + # YADR support alias yav='yadr vim-add-plugin' alias ydv='yadr vim-delete-plugin' @@ -21,10 +30,16 @@ alias cls='clear;ls' # Show human friendly numbers and colors alias df='df -h' -alias ll='ls -alGh' -alias ls='ls -Gh' alias du='du -h -d 2' +if [[ $platform == 'linux' ]]; then + alias ll='ls -alh --color=auto' + alias ls='ls --color=auto' +elif [[ $platform == 'darwin' ]]; then + alias ll='ls -alGh' + alias ls='ls -Gh' +fi + # show me files matching "ls grep" alias lsg='ll | grep'