This repository has been archived on 2022-03-28. You can view files and clone it, but cannot push or open issues or pull requests.
prezto/functions/alias.zsh

121 lines
3.5 KiB
Bash
Raw Normal View History

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
# ------------------------------------------------------------------------------
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
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.
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.
# General
# ------------------------------------------------------------------------------
2011-07-28 15:43:26 -04:00
alias cd='nocorrect cd'
alias cp='nocorrect cp -i'
2011-07-28 15:43:26 -04:00
alias find='noglob find'
alias gcc='nocorrect gcc'
alias ln='nocorrect ln -i'
2011-07-28 15:43:26 -04:00
alias man='nocorrect man'
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'
alias du='du -kh'
alias df='df -kh'
alias pu='pushd'
alias po='popd'
alias _='sudo'
2011-07-14 16:16:22 -04:00
alias o='open'
alias e="$EDITOR"
2011-07-14 16:16:22 -04:00
alias v="$PAGER"
alias b="$BROWSER"
alias history='fc -l 1'
alias get='curl -C - -O'
alias afind='ack -il'
alias type='type -a'
alias ssh='ssh -X'
2011-07-14 16:16:22 -04:00
alias pbc='pbcopy'
alias pbp='pbpaste'
alias print-path='echo -e ${PATH//:/\\n}'
alias t="t --task-dir ~/.tasks --list todo.txt --delete-if-empty"
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'
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
if [[ "$DISABLE_COLOR" != 'true' ]]; then
if [[ -x "${commands[colordiff]}" ]]; then
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'
fi
if [[ -x "${commands[colormake]}" ]]; then
alias make='colormake'
compdef colormake=make
fi
fi
# Terminal Multiplexer
# ------------------------------------------------------------------------------
if [[ "$TERM" == *256color* ]]; then
if [[ -e "$HOME/.screenrc256" ]]; then
screenrc="-c '$HOME/.screenrc256'"
tmuxconf="-f '$HOME/.tmux256.conf'"
fi
else
if [[ -e "$HOME/.screenrc" ]]; then
screenrc="-c '$HOME/.screenrc'"
tmuxconf="-f '$HOME/.tmux.conf'"
fi
fi
alias screen="screen $screenrc"
alias sl="screen $screenrc -list"
alias sr="screen $screenrc -a -A -U -D -R"
alias S="screen $screenrc -U -S"
if (( ${+commands[tmux]} )); then
alias tmux="tmux $tmuxconf"
alias tls="tmux list-sessions"
fi