Skip to content

Instantly share code, notes, and snippets.

@adelcambre
Created December 13, 2009 18:38
Show Gist options
  • Select an option

  • Save adelcambre/255556 to your computer and use it in GitHub Desktop.

Select an option

Save adelcambre/255556 to your computer and use it in GitHub Desktop.
# ----------------------------------------------------------------
# general zsh configuration
# ----------------------------------------------------------------
# crazy tab completion
autoload -U compinit
compinit
# crazy mad shit
setopt auto_resume auto_cd auto_pushd pushd_to_home pushd_silent pushd_minus
setopt pushd_ignore_dups bad_pattern function_argzero inc_append_history
setopt hist_verify hist_no_store hist_no_functions
setopt hist_ignore_dups hist_find_no_dups hist_save_no_dups
setopt nobeep extended_glob prompt_subst interactive_comments
setopt list_types list_packed print_eight_bit nohup notify
setopt print_exit_value
unsetopt bgnice nomatch
HISTSIZE=5000
SAVEHIST=5000
HISTFILE=~/.history
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:$HOME/bin:$HOME/projects/aws/ec2/bin
MANPATH=$MANPATH:/opt/local/man
# EC2 Command line tools setup
export JAVA_HOME="/System/Library/Frameworks/JavaVM.framework/Home/"
export EC2_HOME="/usr/local/Cellar/ec2-api-tools/1.3-41620/"
export EC2_PRIVATE_KEY=$HOME/.aws_keys/pk-WKHIIEA6D4UQUEIZN26RPWW5KRIX5V7Y.pem
export EC2_CERT=$HOME/.aws_keys/cert-WKHIIEA6D4UQUEIZN26RPWW5KRIX5V7Y.pem
# Load aliases
[ -f ~/.aliases ] && source ~/.aliases
# eliminate duplicates from these lists
typeset -U hosts path cdpath fpath fignore manpath mailpath classpath
if [ -f "$HOME/.ssh/known_hosts" ]; then
sshhosts=(${${${${(f)"$(<$HOME/.ssh/known_hosts)"}:#[0-9]*}%%\ *}%%,*})
fi
if [ -f "/etc/hosts" ]; then
: ${(A)etchosts:=${(s: :)${(ps:\t:)${${(f)~~"$(</etc/hosts)"}%%\#*}##[:blank:]#[^[:blank:]]#}}}
fi
hosts=( $hosts $etchosts $sshhosts)
# completion engine additions
# keep cvs and *~ files out
zstyle ':completion:*:(all-|)files' ignored-patterns '(|*/)CVS' '(|*/)*\~'
zstyle ':completion:*:cd:*' ignored-patterns '(|*/)CVS'
# complete hosts from ~/.ssh/known_hosts and /etc/hosts
zstyle ':completion:*:hosts' hosts $hosts
# prompt
autoload -U promptinit
promptinit
# Show branch and dirty in prompt
precmd () {
if [[ -d .git ]]; then
ref=$(git symbolic-ref HEAD 2> /dev/null) || return
CURRENT_BRANCH="[${ref#refs/heads/}$(parse_git_dirty)]"
else
CURRENT_BRANCH=''
fi
}
parse_git_dirty () {
[[ $(git status | tail -n1) != "nothing to commit (working directory clean)" ]] && echo "*"
}
PS1='%{%}%n%{%}@%m%{%}:%(4~|...|)%2~%{%}$CURRENT_BRANCH%(!.#.➤)%{$reset_color%} '
export PAGER="less"
export EDITOR="mate -w"
export LC_ALL="en_US.UTF-8"
# Show `time` output for any command that takes longer than 1 second of CPU time
export REPORTTIME=1
# Defaults, but with bright blue
export LSCOLORS=Exfxcxdxbxegedabagacad
# Need this to make rvm + homebrew happy
export ARCHFLAGS="-arch x86_64"
# Emacs command editing mode
bindkey -e
# Make delete work properly in all cases
bindkey "^[[3~" delete-char
# Disable ^S, useless and annoying
stty stop undef
# Setup rvm
if [ -s ~/.rvm/scripts/rvm ] ; then source ~/.rvm/scripts/rvm ; fi
# stuff for go http://golang.org
export GOROOT=`brew --prefix`/Cellar/go/HEAD
export GOARCH=amd64
export GOOS=darwin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment