From: Jannik ZANDER Date: Wed, 25 May 2016 16:59:49 +0000 (+0200) Subject: Fix ls colors X-Git-Url: https://git.zndr.dk/?a=commitdiff_plain;h=cd2554ab8e125f2deff666a22c94493aca5cf59d;p=dotfiles.git Fix ls colors --- diff --git a/.config/bash/rc/aliases b/.config/bash/rc/aliases index 5bfc85f..14cca14 100644 --- a/.config/bash/rc/aliases +++ b/.config/bash/rc/aliases @@ -1,4 +1,4 @@ -# Git aliases +# Gjkit aliases alias gs='git status -sb ' # Note the trailing space alias ga='git add ' # Note the trailing space alias gbr='git branch ' # Note the trailing space @@ -12,30 +12,22 @@ alias gsl='git stash list' alias gsp='git stash pop' alias sl=ls -alias ls='ls -G' -alias la='ls -AF' -alias ll='ls -al' +alias la='ls -A' +alias ll='ls -Al' alias l1='ls -1' alias l.='ls -d .*' -if [ $OSTYPE != *darwin* ] -then - #alias ls="ls --color=auto" - alias ls="command ls $LS_COMMON" -fi - -LS_COMMON="-hF" -#LS_COMMON="$LS_COMMON -I NTUSER.\* -I ntuser.\*" - +flags="-hF" # Detect which `ls` flavor is in use -if whence dircolors > /dev/null 2>&1; then # GNU `ls` +if [ -x "$(which dircolors 2>/dev/null)" ]; then # GNU `ls` eval $(dircolors -b $HOME/.dir_colors) - colorflag="--color" + flags="$flags --color=auto" + flags="$flags -I NTUSER.\* -I ntuser.\*" else # OS X `ls` - #eval $(gdircolors $HOME/.dircolors) export CLICOLOR=1 - colorflag="-G" + flags="$flags -G" fi +alias ls="ls $flags" # Shortcuts alias g='git'