Skip to content

Instantly share code, notes, and snippets.

@dorfire
Created April 20, 2012 10:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dorfire/2427758 to your computer and use it in GitHub Desktop.
Save dorfire/2427758 to your computer and use it in GitHub Desktop.
My cool ~/.zshrc file
export PATH=/usr/local/bin:/usr/local/share/python:$PATH
export LSCOLORS=dxfxcxdxbxegedabagacad
autoload -U colors && colors
setopt PROMPT_SUBST
setopt autocd
setopt hist_reduce_blanks
function prompt_char
{
hg root >/dev/null 2>/dev/null && echo '☿' && return
git branch >/dev/null 2>/dev/null && echo '±' && return
echo ''
}
function prompt_char_chpwd { PROMPT="%~%{$fg_bold[green]%}$(prompt_char)%{$reset_color%} "; }
prompt_char_chpwd
typeset -ga chpwd_functions
chpwd_functions+='prompt_char_chpwd'
RPROMPT="%(?,%F{green}:%),%F{yellow}%? %F{red}:()%f";
function pfd
{
osascript 2>/dev/null <<EOF
tell application "Finder"
return POSIX path of (target of window 1 as alias)
end tell
EOF
}
function cdf
{
cd "$(pfd)"
}
alias bk='cd $OLDPWD'
alias ls='ls -aG'
alias lh='ls -a | egrep "^\."'
# Mercurial
alias h='hg status'
alias hc='hg commit'
alias push='hg push'
alias pull='hg pull'
# Sort files in current directory by line count
alias lines='wc -w * | sort | tail -n10'
# Django
alias pm='python manage.py'
alias pmr='python manage.py runserver'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment