diff --git a/aliases/available/general.aliases.bash b/aliases/available/general.aliases.bash index 0c7bcd9dfd..2185971e3f 100644 --- a/aliases/available/general.aliases.bash +++ b/aliases/available/general.aliases.bash @@ -12,15 +12,15 @@ fi # List directory contents alias sl=ls alias la='ls -AF' # Compact view, show hidden -alias ll='ls -al' -alias l='ls -a' +alias ll='ls -Al' +alias l='ls -A' alias l1='ls -1' alias _="sudo" # Shortcuts to edit startup files -alias vbrc="vim ~/.bashrc" -alias vbpf="vim ~/.bash_profile" +alias vbrc='${EDITOR:-vim} ~/.bashrc' +alias vbpf='${EDITOR:-vim} ~/.bash_profile' # colored grep # Need to check an existing file for a pattern that will be found to ensure @@ -30,10 +30,8 @@ then alias grep='grep --color=auto' fi -if which gshuf &> /dev/null -then - alias shuf=gshuf -fi +_command_exists gshuf \ + && alias shuf=gshuf alias c='clear' alias k='clear' @@ -52,8 +50,8 @@ alias py='python' alias ipy='ipython' # Pianobar can be found here: http://github.com/PromyLOPh/pianobar/ - -alias piano='pianobar' +_command_exists pianobar \ + && alias piano='pianobar' alias ..='cd ..' # Go up one directory alias cd..='cd ..' # Common misspelling for going up one directory @@ -65,17 +63,16 @@ alias -- -='cd -' # Go back alias h='history' # Tree -if [ ! -x "$(which tree 2>/dev/null)" ] -then - alias tree="find . -print | sed -e 's;[^/]*/;|____;g;s;____|; |;g'" -fi +_command_exists tree \ + || alias tree="find . -print | sed -e 's;[^/]*/;|____;g;s;____|; |;g'" # Directory alias md='mkdir -p' alias rd='rmdir' # Shorten extract -alias xt="extract" +_command_exists 'extract' \ + && alias xt="extract" # sudo editors alias svim="sudo vim"