2011-07-28 21:43:26 +02:00
|
|
|
setopt correct # Correct commands.
|
|
|
|
setopt correct_all # Correct all arguments.
|
|
|
|
|
2011-07-14 22:16:22 +02:00
|
|
|
# The 'ls' Family
|
2011-05-31 00:39:04 +02:00
|
|
|
# ------------------------------------------------------------------------------
|
2011-06-01 08:48:26 +02: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-31 00:39:04 +02:00
|
|
|
|
2011-06-01 08:48:26 +02: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 22:16:22 +02:00
|
|
|
alias lc='ls -lhtcr' # Sort by and show change time, most recent last.
|
2011-06-01 08:48:26 +02: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-31 00:39:04 +02:00
|
|
|
|
|
|
|
# General
|
|
|
|
# ------------------------------------------------------------------------------
|
2011-07-28 21:43:26 +02:00
|
|
|
alias cd='nocorrect cd'
|
2011-05-31 00:39:04 +02:00
|
|
|
alias cp='nocorrect cp -i'
|
2011-07-28 21:43:26 +02:00
|
|
|
alias find='noglob find'
|
|
|
|
alias gcc='nocorrect gcc'
|
2011-05-31 00:39:04 +02:00
|
|
|
alias ln='nocorrect ln -i'
|
2011-07-28 21:43:26 +02:00
|
|
|
alias man='nocorrect man'
|
2011-05-31 00:39:04 +02:00
|
|
|
alias mkdir='nocorrect mkdir -p'
|
2011-07-28 21:43:26 +02:00
|
|
|
alias mv='nocorrect mv -i'
|
|
|
|
alias rm='nocorrect rm -i'
|
|
|
|
alias scp='nocorrect scp'
|
2011-05-31 00:39:04 +02:00
|
|
|
alias du='du -kh'
|
|
|
|
alias df='df -kh'
|
|
|
|
alias pu='pushd'
|
|
|
|
alias po='popd'
|
2009-08-28 20:14:17 +02:00
|
|
|
alias _='sudo'
|
2011-07-14 22:16:22 +02:00
|
|
|
alias o='open'
|
2011-05-31 00:39:04 +02:00
|
|
|
alias e="$EDITOR"
|
2011-07-14 22:16:22 +02:00
|
|
|
alias v="$PAGER"
|
|
|
|
alias b="$BROWSER"
|
2011-05-31 00:39:04 +02:00
|
|
|
alias history='fc -l 1'
|
|
|
|
alias get='curl -C - -O'
|
2011-06-01 08:48:26 +02:00
|
|
|
alias afind='ack -il'
|
2011-05-31 00:39:04 +02:00
|
|
|
alias type='type -a'
|
|
|
|
alias ssh='ssh -X'
|
2011-07-14 22:16:22 +02:00
|
|
|
alias pbc='pbcopy'
|
|
|
|
alias pbp='pbpaste'
|
2011-05-31 00:39:04 +02:00
|
|
|
alias print-path='echo -e ${PATH//:/\\n}'
|
2011-06-01 08:48:26 +02:00
|
|
|
alias t="t --task-dir ~/.tasks --list todo.txt --delete-if-empty"
|
2009-08-28 20:14:17 +02:00
|
|
|
|
2011-07-28 21:43:26 +02: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-31 00:39:04 +02:00
|
|
|
if [[ -x "${commands[htop]}" ]]; then
|
|
|
|
alias top=htop
|
|
|
|
else
|
|
|
|
alias topm='top -o vsize'
|
|
|
|
alias topc='top -o cpu'
|
|
|
|
fi
|
2009-09-03 20:45:23 +02:00
|
|
|
|
2011-06-01 08:48:26 +02:00
|
|
|
if [[ "$DISABLE_COLOR" != 'true' ]]; then
|
|
|
|
if [[ -x "${commands[colordiff]}" ]]; then
|
2011-07-14 22:19:00 +02: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 08:48:26 +02:00
|
|
|
fi
|
|
|
|
|
|
|
|
if [[ -x "${commands[colormake]}" ]]; then
|
|
|
|
alias make='colormake'
|
2011-07-14 22:19:00 +02:00
|
|
|
compdef colormake=make
|
2011-06-01 08:48:26 +02:00
|
|
|
fi
|
|
|
|
fi
|
2009-08-28 20:14:17 +02:00
|
|
|
|
2011-06-01 08:48:26 +02:00
|
|
|
# Terminal Multiplexer
|
2011-07-28 22:01:32 +02:00
|
|
|
alias sl="screen -list"
|
|
|
|
alias sr="screen -a -A -U -D -R"
|
|
|
|
alias sn="screen -U -S"
|
|
|
|
alias tl="tmux list-sessions"
|
2010-12-24 23:20:57 +01:00
|
|
|
|