Skip to content

Instantly share code, notes, and snippets.

@lest
Created March 1, 2010 17:25
Show Gist options
  • Save lest/318583 to your computer and use it in GitHub Desktop.
Save lest/318583 to your computer and use it in GitHub Desktop.
.zshrc
[ -f $HOME/.profile ] && . $HOME/.profile
HISTSIZE=2000
SAVEHIST=$HISTSIZE
HISTFILE=$HOME/.zsh_history
setopt append_history
setopt inc_append_history
setopt extended_history
setopt hist_find_no_dups
setopt hist_ignore_all_dups
setopt hist_reduce_blanks
setopt hist_ignore_space
setopt hist_no_store
setopt hist_no_functions
setopt no_hist_beep
setopt hist_save_no_dups
setopt prompt_subst
[[ -z "$terminfo[kdch1]" ]] || bindkey -M emacs "$terminfo[kdch1]" delete-char
[[ -z "$terminfo[khome]" ]] || bindkey -M emacs "$terminfo[khome]" beginning-of-line
[[ -z "$terminfo[kend]" ]] || bindkey -M emacs "$terminfo[kend]" end-of-line
autoload -U compinit && compinit
autoload -U select-word-style && select-word-style bash
autoload -U colors && colors
autoload -U vcs_info
zstyle ':vcs_info:*' enable git svn
zstyle ':vcs_info:*' actionformats '(%s)-[%b|%a] '
zstyle ':vcs_info:*' formats '(%s)-[%b] '
zstyle ':vcs_info:(sv[nk]|bzr):*' branchformat '%b:%r'
zstyle ':completion:*' menu select
zstyle ':completion:*' matcher-list '' 'm:{a-zA-Z}={A-Za-z}'
precmd() {
print -Pn "\e]0;%~\a"
vcs_info
}
preexec() {
print -Pn "\e]0;%~ :: $1\a"
}
PROMPT='%B%F{blue}%~%f%b ${vcs_info_msg_0_}%B%F{blue}%#%f%b '
RPROMPT='%B%F{green}%T%'
# $($HOME/.rvm/bin/rvm-prompt i v g -d 2> /dev/null)
eval `gdircolors` && zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS}
# aliases
alias ls='gls --color=always'
alias grep='grep --color=always'
alias less='less -R'
alias pwgen='pwgen -1cnsB'
alias ack='ack -a'
alias wget='wget --no-check-certificate'
alias edit='$EDITOR'
# editor
export EDITOR='/Applications/Emacs.app/Contents/MacOS/bin/emacsclient'
# RVM
if [ -s $HOME/.rvm/scripts/rvm ]; then
. $HOME/.rvm/scripts/rvm
rvm rvmrc load
fi
# bundler
BUNDLED_COMMANDS=(cap cucumber irb rails rake rspec ruby)
bundler-gemfile-present() {
local dir="$(pwd)"
while [ "$(dirname $dir)" != "/" ]; do
[ -f "$dir/Gemfile" ] && return
dir="$(dirname $dir)"
done
false
}
bundler-run() {
local command="$1"
shift
if $(which bundle > /dev/null 2>&1) && bundler-gemfile-present; then
bundle exec $command "$@"
else
$command "$@"
fi
}
for CMD in $BUNDLED_COMMANDS; do
alias $CMD="bundler-run $CMD"
done
# kerl
[ -s $HOME/.kerl/activate ] && . $HOME/.kerl/activate
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment