Skip to content

Instantly share code, notes, and snippets.

@robbyrussell
Created April 26, 2011 17:01
Show Gist options
  • Select an option

  • Save robbyrussell/942661 to your computer and use it in GitHub Desktop.

Select an option

Save robbyrussell/942661 to your computer and use it in GitHub Desktop.
oh-my-zsh v0.0.1
# my ~/.zshrc BEFORE oh-my-zsh
# Input stuff.
bindkey -e
# History stuff.
setopt HIST_VERIFY
setopt INC_APPEND_HISTORY
setopt SHARE_HISTORY
setopt EXTENDED_HISTORY
setopt HIST_IGNORE_DUPS
## Command history configuration
#
HISTFILE=~/.zsh_history
HISTSIZE=2500
SAVEHIST=2500
setopt hist_ignore_dups # ignore duplication command history list
setopt share_history # share command history data
# Visual stuff.
autoload colors; colors
unset LSCOLORS
export LS_COLORS='di=34:ln=35:so=32:pi=33:ex=31:bd=46;34:cd=43;34:su=41;30:sg=46;30:tw=42;30:ow=43;30'
if [[ x$WINDOW != x ]]
then
SCREEN_NO="%B$WINDOW%b "
else
SCREEN_NO=""
fi
PS1="%n@%m:%~%# "
# Directory stuff.
setopt AUTO_NAME_DIRS
# Speed stuff.
#setopt NO_BEEP
setopt AUTO_CD
setopt MULTIOS
setopt CDABLEVARS
alias c='cd'
alias pu='pushd'
alias po='popd'
alias mr='mate CHANGELOG app config db lib public script spec test'
alias .='pwd'
alias ...='cd ../..'
alias ....='cd ../../..'
alias .....='cd ../../../..'
alias ......='cd ../../../../..'
alias .......='cd ../../../../../..'
alias _='sudo'
alias ss='setsid'
alias g='grep -in'
alias s='svn'
alias e='mate'
alias history='fc -l 1'
# Git aliases
alias utb='tar jxvf'
alias utz='tar zxvf'
alias ls='ls -GF'
alias ll='ls -al'
alias sgem='sudo gem'
alias rfind='find . -name *.rb | xargs grep -n'
alias xenon='ssh rrussell@xenon.planetargon.com'
alias git-svn-dcommit-push='git svn dcommit && git push github master:svntrunk'
bindkey '\ew' kill-region
bindkey -s '\el' "ls\n"
bindkey -s '\e.' "..\n"
# Shitty bloat
autoload -U incremental-complete-word
zle -N incremental-complete-word
bindkey "^Xi" incremental-complete-word ## C-x-i
setopt noautomenu
setopt COMPLETE_IN_WORD
setopt ALWAYS_TO_END
unsetopt flowcontrol
WORDCHARS=''
autoload -U compinit
compinit
zmodload -i zsh/complist
zstyle ':completion:*' list-colors ''
zstyle ':completion:*' hosts $( sed 's/[, ].*$//' $HOME/.ssh/known_hosts )
unsetopt MENU_COMPLETE
setopt AUTO_MENU
bindkey -M menuselect '^o' accept-and-infer-next-history
zstyle ':completion:*:*:*:*:*' menu yes select
# zstyle ':completion:*:*:*:*:processes' force-list always
zstyle ':completion:*:*:kill:*:processes' list-colors '=(#b) #([0-9]#) ([0-9a-z-]#)*=01;34=0=01'
zstyle ':completion:*:*:*:*:processes' command "ps -u `whoami` -o pid,user,comm -w -w"
zstyle ':completion:*:*:(ssh|scp):*:*' hosts `sed 's/^\([^ ,]*\).*$/\1/' ~/.ssh/known_hosts`
# hosts=(teepee wigwam google.com)
# zstyle ':completion:*' hosts $hosts
################################################################################
# Functions
################################################################################
function title {
if [[ $TERM == "screen" ]]; then
# Use these two for GNU Screen:
print -nR $'\033k'$1$'\033'\\\
print -nR $'\033]0;'$2$'\a'
elif [[ $TERM == "xterm" || $TERM == "rxvt" ]]; then
# Use this one instead for XTerms:
print -nR $'\033]0;'$*$'\a'
fi
}
function precmd {
title zsh "$PWD"
}
function preexec {
emulate -L zsh
local -a cmd; cmd=(${(z)1})
title $cmd[1]:t "$cmd[2,-1]"
}
function pap { curl -s $1 | patch -p0; }
function ruby184 { PATH=~/local/bin:$PATH }
# get the name of the branch we are on
function git_prompt_info() {
ref=$(git symbolic-ref HEAD 2> /dev/null) || return
echo "git:(${ref#refs/heads/})"
}
################################################################################
# Environment Variables
################################################################################
# Environment variables.
export EDITOR=/opt/local/bin/joe
export PAGER=less
# Adding /opt/local/bin and PostgreSQL to my PATH
export PATH=~/bin:/opt/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/local/sbin:/opt/local/lib/postgresql83/bin
source $HOME/.rake_completion.zsh
export LC_CTYPE=en_US.UTF-8
export AMAZON_ACCESS_KEY_ID='0RW0FCHEB4SDQRDNWTG2'
export AMAZON_SECRET_ACCESS_KEY='eznOJlqNdPX7xml9+jJCxTnMUCLTqYFCOv0o58NF'
# Setup the prompt with pretty colors
setopt prompt_subst
## terminal configuration
export LSCOLORS="Gxfxcxdxbxegedabagacad"
PROMPT='%{$fg_bold[green]%}%p %{$fg[cyan]%}%c %{$fg_bold[red]%}$(git_prompt_info)%{$fg[blue]%}: % %{$reset_color%}'
#
# Color grep results
# Examples: http://rubyurl.com/ZXv
#
export GREP_OPTIONS='--color=auto'
export GREP_COLOR='1;32'
@nicoulaj
Copy link

export AMAZON_ACCESS_KEY_ID='XXX'
export AMAZON_SECRET_ACCESS_KEY='XXX'

Hum

@robbyrussell
Copy link
Author

robbyrussell commented Apr 26, 2011 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment