From 59789f8c8c1135429ccf2a148a03aa62048d930b Mon Sep 17 00:00:00 2001 From: Sorin Ionescu Date: Sun, 29 May 2011 21:24:53 -0400 Subject: [PATCH] Added new aliases, changed and fixed bugs in old aliases. --- custom/aliases.zsh | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/custom/aliases.zsh b/custom/aliases.zsh index bd7632ab..e2d743c5 100644 --- a/custom/aliases.zsh +++ b/custom/aliases.zsh @@ -4,12 +4,12 @@ [[ -x "${commands[gdircolors]}" ]] && use_color_gnu='true' || use_color_bsd='true' } -[[ "$use_color_gnu" == 'true' ]] && eval $(gdircolors $HOME/.dir_colors) +[[ "$use_color_gnu" == 'true' && -e "$HOME/.dir_colors" ]] && eval $(gdircolors $HOME/.dir_colors) [[ "$use_color_bsd" == 'true' ]] && export CLICOLOR=1 [[ "$use_color_bsd" == 'true' ]] && export LSCOLORS="exfxcxdxbxegedabagacad" # add colors for filetype recognition -[[ "$use_color_gnu" == 'true' ]] && alias ls='ls -hF --group-directories-first --color=auto' +[[ "$use_color_gnu" == 'true' ]] && alias ls='ls -hF --group-directories-first --color=auto' [[ "$use_color_bsd" == 'true' ]] && alias ls='ls -G -F' alias la='ls -Ahl' # show hidden files @@ -29,15 +29,17 @@ alias rm='nocorrect rm -i' alias cp='nocorrect cp -i' alias mv='nocorrect mv -i' alias ln='nocorrect ln -i' +alias mkdir='nocorrect mkdir -p' alias du='du -kh' alias df='df -kh' -alias e="$EDITOR" +alias e="$EDITOR" alias get='curl -C - -O' -alias mkdir='nocorrect mkdir -p' alias q='exit' alias ssh='ssh -X' alias h='history' alias j='jobs -l' +alias f='fg' +alias gr='grep -r' alias type='type -a' alias print-path='echo -e ${PATH//:/\\n}' alias print-libpath='echo -e ${LD_LIBRARY_PATH//:/\\n}' @@ -58,17 +60,17 @@ fi # Screen # ------------------------------------------------------------------------------ -[[ "$TERM" == 'xterm-color' ]] && screenrc="$HOME/.screenrc" -[[ "$TERM" == 'xterm-256color' ]] && screenrc="$HOME/.screenrc256" -alias screen="screen -c '$screenrc'" -alias sls="screen -c '$screenrc' -list" -alias surd="screen -c '$screenrc' -aAURD" -alias sus="screen -c '$screenrc' -US" +[[ "$TERM" == 'xterm-color' && -e "$HOME/.screenrc" ]] && screenrc="-c '$HOME/.screenrc'" +[[ "$TERM" == 'xterm-256color' && -e "$HOME/.screenrc256" ]] && screenrc="-c '$HOME/.screenrc256'" +alias screen="screen $screenrc" +alias sl="screen $screenrc -list" +alias sr="screen $screenrc -a -A -U -D -R" +alias S="screen $screenrc -U -S" # TMUX # ------------------------------------------------------------------------------ -[[ "$TERM" == 'xterm-color' ]] && tmuxconf="$HOME/.tmux.conf" -[[ "$TERM" == 'xterm-256color' ]] && tmuxconf="$HOME/.tmux256.conf" -alias tmux="tmux -f '$tmuxconf'" +[[ "$TERM" == 'xterm-color' && -e "$HOME/.tmux.conf" ]] && tmuxconf="-f '$HOME/.tmux.conf'" +[[ "$TERM" == 'xterm-256color' && -e "$HOME/.tmux256.conf" ]] && tmuxconf="-f '$HOME/.tmux256.conf'" +alias tmux="tmux $tmuxconf" alias tls="tmux list-sessions"