Created
July 21, 2011 11:39
-
-
Save davorb/1097017 to your computer and use it in GitHub Desktop.
zshrc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/zsh | |
HISTFILE=~/.histfile | |
HISTSIZE=10000 # about a year's worth | |
SAVEHIST=10000 | |
bindkey -e | |
# don't overwrite history | |
setopt APPEND_HISTORY | |
# write history after each command | |
setopt INC_APPEND_HISTORY | |
# share history between multiple shells | |
setopt SHARE_HISTORY | |
# reduce blanks | |
setopt HIST_REDUCE_BLANKS | |
# don't save lines starting with space | |
setopt HIST_IGNORE_SPACE | |
setopt HIST_NO_STORE | |
# type 'dir' instead of 'cd dir' | |
setopt AUTO_CD | |
# spell check commands | |
setopt CORRECT | |
# named dirs when possible | |
# setopt AUTO_NAMED_DIRS # didn't work | |
# 10s wait if you do something that will | |
# delete everything | |
setopt RM_STAR_WAIT | |
export PAGER=less | |
# End of lines configured by zsh-newuser-install | |
# The following lines were added by compinstall | |
zstyle :compinstall filename '/home/davor/.zshrc' | |
autoload -Uz compinit | |
compinit | |
# End of lines added by compinstall | |
#export GEM_HOME=$HOME/bin/gems | |
#export GEM_PATH=$GEM_HOME/bin | |
#:$GEM_PATH | |
export GITHUB_USER=davorb | |
export GITHUB_TOKEN=b4b1429145ed5b34cebb899404187ebd | |
# Skip all this for non-interactive shells | |
[[ -z "$PS1" ]] && return | |
# Set default editor | |
if [[ -x $(which emacs) ]] | |
then | |
export EDITOR="emacs" | |
export USE_EDITOR=$EDITOR | |
export VISUAL=$EDITOR | |
fi | |
# Say how long a command took, if it took more than 30 seconds | |
export REPORTTIME=30 | |
# Enable color support of ls | |
if [[ "$TERM" != "dumb" ]]; then | |
if [[ -x `which dircolors` ]]; then | |
eval `dircolors -b` | |
alias 'ls=ls -h --color=auto' | |
alias 'grep=grep --color=always' | |
fi | |
fi | |
if [[ `uname` == 'Linux' ]]; then | |
export PATH=$PATH:$HOME/bin:$HOME/bin/bin | |
fi | |
if [[ `uname` == 'Darwin' ]]; then | |
alias 'ls=ls -G -h' | |
alias 'grep=grep --color=always' | |
source /Users/davor/.rvm/scripts/rvm | |
export PATH=$PATH:$HOME/bin | |
fi | |
alias 'git diff=git diff --color=always' | |
#alias 'ruby=ruby1.9.1' | |
#alias 'ri=ri1.9.1' | |
#alias 'irb=irb1.9.1' | |
#alias 'rake=~/bin/gems/bin/rake' | |
alias rake="noglob rake" # allows square brackts for rake task invocation | |
alias brake='noglob bundle exec rake' # execute the bundled rake gem | |
alias srake='noglob sudo rake' # noglob must come before sudo | |
alias sbrake='noglob sudo bundle exec rake' # altogether now ... | |
# rvm | |
[[ -s "/home/davor/.rvm/scripts/rvm" ]] && source "/home/davor/.rvm/scripts/rvm" # This loads RVM into a shell session. | |
# Quick find | |
f() { | |
echo "find . -iname \"*$1*\"" | |
find . -iname "*$1*" | |
} | |
zstyle -d users | |
zstyle ':completion:*:*:*:users' ignored-patterns \ | |
adm apache bin daemon games gdm halt ident junkbust lp mail mailnull \ | |
named news nfsnobody nobody nscd ntp operator pcap postgres radvd \ | |
rpc rpcuser rpm shutdown squid sshd sync uucp vcsa xfs backup bind \ | |
dictd gnats identd irc man messagebus postfix proxy sys www-data \ | |
avahi Debian-exim hplip list cupsys haldaemon ntpd proftpd statd | |
#automatically display the current directory in the xterm title bar | |
chpwd() { | |
[[ -o interactive ]] || return | |
case $TERM in | |
sun-cmd) print -Pn "\e]l%~\e\\" | |
;; | |
*xterm*|rxvt|(dt|k|E)term) print -Pn "\e]2;%~\a" | |
;; | |
esac | |
} | |
#color your stderr | |
#exec 2>>(while read line; do | |
# print '\n\e[91m'${(q)line}'\e[0m' > /dev/tty; print -n $'\0'; done &) | |
# prompt | |
# autoload -U promptinit | |
# promptinit | |
# prompt redhat | |
autoload -U colors && colors | |
PROMPT="%C$fg[red]%# $reset_color" | |
PATH=$PATH:$HOME/.rvm/bin # Add RVM to PATH for scripting |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment