2011-07-28 15:43:26 -04:00
|
|
|
setopt correct # Correct commands.
|
|
|
|
setopt correct_all # Correct all arguments.
|
|
|
|
|
2011-07-14 16:16:22 -04:00
|
|
|
# The 'ls' Family
|
2011-05-30 18:39:04 -04:00
|
|
|
# ------------------------------------------------------------------------------
|
2011-06-01 02:48:26 -04:00
|
|
|
if [[ "$DISABLE_COLOR" != 'true' ]]; then
|
|
|
|
if (( ${+commands[dircolors]} )); then
|
|
|
|
dircolors="${commands[dircolors]}"
|
|
|
|
fi
|
|
|
|
if (( ${+commands[gdircolors]} )); then
|
|
|
|
dircolors="${commands[gdircolors]}"
|
|
|
|
fi
|
|
|
|
if [[ -x "$dircolors" ]] && [[ -e "$HOME/.dir_colors" ]]; then
|
|
|
|
eval $("$dircolors" "$HOME/.dir_colors")
|
|
|
|
alias ls='ls -hF --group-directories-first --color=auto'
|
|
|
|
else
|
|
|
|
export CLICOLOR=1
|
|
|
|
export LSCOLORS="exfxcxdxbxegedabagacad"
|
|
|
|
alias ls='ls -G -F'
|
|
|
|
fi
|
|
|
|
fi
|
2011-05-30 18:39:04 -04:00
|
|
|
|
2011-06-01 02:48:26 -04:00
|
|
|
alias ll='ls -lh' # Show human readable.
|
|
|
|
alias la='ls -lhA' # Show hidden files.
|
|
|
|
alias lx='ls -lhXB' # Sort by extension.
|
|
|
|
alias lk='ls -lhSr' # Sort by size, biggest last.
|
2011-07-14 16:16:22 -04:00
|
|
|
alias lc='ls -lhtcr' # Sort by and show change time, most recent last.
|
2011-06-01 02:48:26 -04:00
|
|
|
alias lu='ls -lhtur' # Sort by and show access time, most recent last.
|
|
|
|
alias lt='ls -lhtr' # Sort by date, most recent last.
|
|
|
|
alias lm='ls -lha | more' # Pipe through 'more'.
|
|
|
|
alias lr='ls -lhR' # Recursive ls.
|
|
|
|
alias sl='ls' # I often screw this up.
|
2011-05-30 18:39:04 -04:00
|
|
|
|
|
|
|
# General
|
|
|
|
# ------------------------------------------------------------------------------
|
2011-07-28 15:43:26 -04:00
|
|
|
alias cd='nocorrect cd'
|
2011-05-30 18:39:04 -04:00
|
|
|
alias cp='nocorrect cp -i'
|
2011-07-28 15:43:26 -04:00
|
|
|
alias find='noglob find'
|
|
|
|
alias gcc='nocorrect gcc'
|
2011-05-30 18:39:04 -04:00
|
|
|
alias ln='nocorrect ln -i'
|
2011-07-28 15:43:26 -04:00
|
|
|
alias man='nocorrect man'
|
2011-05-30 18:39:04 -04:00
|
|
|
alias mkdir='nocorrect mkdir -p'
|
2011-07-28 15:43:26 -04:00
|
|
|
alias mv='nocorrect mv -i'
|
|
|
|
alias rm='nocorrect rm -i'
|
|
|
|
alias scp='nocorrect scp'
|
2011-05-30 18:39:04 -04:00
|
|
|
alias du='du -kh'
|
|
|
|
alias df='df -kh'
|
|
|
|
alias pu='pushd'
|
|
|
|
alias po='popd'
|
2009-08-28 14:14:17 -04:00
|
|
|
alias _='sudo'
|
2011-07-14 16:16:22 -04:00
|
|
|
alias o='open'
|
2011-05-30 18:39:04 -04:00
|
|
|
alias e="$EDITOR"
|
2011-07-14 16:16:22 -04:00
|
|
|
alias v="$PAGER"
|
|
|
|
alias b="$BROWSER"
|
2011-05-30 18:39:04 -04:00
|
|
|
alias history='fc -l 1'
|
|
|
|
alias get='curl -C - -O'
|
2011-06-01 02:48:26 -04:00
|
|
|
alias afind='ack -il'
|
2011-05-30 18:39:04 -04:00
|
|
|
alias type='type -a'
|
|
|
|
alias ssh='ssh -X'
|
2011-07-14 16:16:22 -04:00
|
|
|
alias pbc='pbcopy'
|
|
|
|
alias pbp='pbpaste'
|
2011-05-30 18:39:04 -04:00
|
|
|
alias print-path='echo -e ${PATH//:/\\n}'
|
2011-06-01 02:48:26 -04:00
|
|
|
alias t="t --task-dir ~/.tasks --list todo.txt --delete-if-empty"
|
2009-08-28 14:14:17 -04:00
|
|
|
|
2011-07-28 15:43:26 -04:00
|
|
|
(( $+commands[ebuild] )) && alias ebuild='nocorrect ebuild'
|
|
|
|
(( $+commands[gist] )) && alias gist='nocorrect gist'
|
|
|
|
(( $+commands[heroku] )) && alias heroku='nocorrect heroku'
|
|
|
|
(( $+commands[hpodder] )) && alias hpodder='nocorrect hpodder'
|
|
|
|
(( $+commands[mysql] )) && alias mysql='nocorrect mysql'
|
|
|
|
|
2011-05-30 18:39:04 -04:00
|
|
|
if [[ -x "${commands[htop]}" ]]; then
|
|
|
|
alias top=htop
|
|
|
|
else
|
|
|
|
alias topm='top -o vsize'
|
|
|
|
alias topc='top -o cpu'
|
|
|
|
fi
|
2009-09-03 14:45:23 -04:00
|
|
|
|
2011-06-01 02:48:26 -04:00
|
|
|
if [[ "$DISABLE_COLOR" != 'true' ]]; then
|
|
|
|
if [[ -x "${commands[colordiff]}" ]]; then
|
2011-07-14 16:19:00 -04:00
|
|
|
alias diff='colordiff -u'
|
|
|
|
compdef colordiff=diff
|
|
|
|
elif [[ -x "${commands[git]}" ]]; then
|
|
|
|
function diff() {
|
|
|
|
git --no-pager diff --color=always --no-ext-diff --no-index "$@";
|
|
|
|
}
|
|
|
|
compdef _git diff=git-diff
|
|
|
|
else
|
|
|
|
alias diff='diff -u'
|
2011-06-01 02:48:26 -04:00
|
|
|
fi
|
|
|
|
|
|
|
|
if [[ -x "${commands[colormake]}" ]]; then
|
|
|
|
alias make='colormake'
|
2011-07-14 16:19:00 -04:00
|
|
|
compdef colormake=make
|
2011-06-01 02:48:26 -04:00
|
|
|
fi
|
|
|
|
fi
|
2009-08-28 14:14:17 -04:00
|
|
|
|
2011-06-01 02:48:26 -04:00
|
|
|
# Terminal Multiplexer
|
2011-05-30 18:39:04 -04:00
|
|
|
# ------------------------------------------------------------------------------
|
2011-07-14 17:17:34 -04:00
|
|
|
if [[ "$TERM" == *256color* ]]; then
|
2011-06-01 02:48:26 -04:00
|
|
|
if [[ -e "$HOME/.screenrc256" ]]; then
|
|
|
|
screenrc="-c '$HOME/.screenrc256'"
|
|
|
|
tmuxconf="-f '$HOME/.tmux256.conf'"
|
|
|
|
fi
|
2011-07-14 17:17:34 -04:00
|
|
|
else
|
|
|
|
if [[ -e "$HOME/.screenrc" ]]; then
|
|
|
|
screenrc="-c '$HOME/.screenrc'"
|
|
|
|
tmuxconf="-f '$HOME/.tmux.conf'"
|
|
|
|
fi
|
2011-06-01 02:48:26 -04:00
|
|
|
fi
|
|
|
|
|
2011-05-30 18:39:04 -04:00
|
|
|
alias screen="screen $screenrc"
|
|
|
|
alias sl="screen $screenrc -list"
|
|
|
|
alias sr="screen $screenrc -a -A -U -D -R"
|
|
|
|
alias S="screen $screenrc -U -S"
|
2009-08-28 14:14:17 -04:00
|
|
|
|
2011-07-14 17:17:34 -04:00
|
|
|
if (( ${+commands[tmux]} )); then
|
|
|
|
alias tmux="tmux $tmuxconf"
|
|
|
|
alias tls="tmux list-sessions"
|
|
|
|
fi
|
2010-12-24 17:20:57 -05:00
|
|
|
|