Please bear with us as we work to restore functionality to dotfiles.org.
this file represents four years of accumulation. I don't even remember what half the options does anymore. But it's in my menumnemonic now.
# The following lines were added by compinstall
zstyle :compinstall filename '~/.zshrc'
autoload -Uz compinit
compinit
# End of lines added by compinstall
HISTFILE=~/.zsh_history
HISTSIZE=50000
SAVEHIST=50000
setopt appendhistory autocd extendedglob notify
unsetopt beep
bindkey -e
# End of lines configured by zsh-newuser-install
# don't send hang-up to running jobs when quitting
setopt NO_HUP
# correct first token on line
setopt CORRECT
setopt AUTO_PUSHD
## --- Disable shell timeout ---
unset TMOUT
ssh_hosts=(\
omitted for security reasons
)
# Print out current calendar with highlighted day
calendar() {
if [[ ! -f /usr/bin/cal ]] ; then
echo "Please install cal before trying to use it!"
return
fi
if [[ "$#" = "0" ]] ; then
/usr/bin/cal | egrep -C 40 --color "\<$(date +%e| tr -d ' ')\>"
else
/usr/bin/cal $@ | egrep -C 40 --color "\<($(date +%B)|$(date +%e | tr -d ' '))\>"
fi
}
alias cal=calendar
# Remove useless files
clean () {
if [ "$1" = "-r" ]; then
find . \( -name '#*' -o -name '*~' -o -name '.*~' -o -name 'core*' \
-o -name 'dead*' \) -ok rm '{}' ';'
else
rm -i \#* *~ .*~ core* dead*
fi
}
# Extract most types of archive
extract() {
if [[ -z "$1" ]]; then
print -P "usage: \e[1;36mextract\e[1;0m < filename >"
print -P " Extract the file specified based on the extension"
elif [[ -f $1 ]]; then
case ${(L)1} in
*.tar.bz2) tar -jxvf $1;;
*.tar.gz) tar -zxvf $1;;
*.bz2) bunzip2 $1 ;;
*.gz) gunzip $1 ;;
*.jar) unzip $1 ;;
*.rar) unrar x $1 ;;
*.tar) tar -xvf $1 ;;
*.tbz2) tar -jxvf $1;;
*.tgz) tar -zxvf $1;;
*.zip) unzip $1 ;;
*.Z) uncompress $1;;
*) echo "Unable to extract '$1' :: Unknown extension"
esac
else
echo "File ('$1') does not exist!"
fi
}
compctl -g '*.tar.bz2 *.tar.gz *.bz2 *.gz *.jar *.rar *.tar *.tbz2 *.tgz *.zip *.Z' + -g '*(-/)' extract
# Create a diff
mdiff() { diff -udrP "$1" "$2" > diff.$(date "+%Y-%m-%d")."$1" }
# Reset current directory to sensible permissions
saneperms() {
find . -type d -print0 | xargs -0 chmod 755
find . -type f -print0 | xargs -0 chmod 644
}
alias ll='ls -la --color=auto'
alias l='ls -l --color=auto'
alias gtd='emacs -f gtd'
alias lesshtml='/usr/bin/w3m -dump -T text/html'
alias mplayer='mplayer -vo x11'
export EDITOR=emacs
export BROWSER=firefox
export XTERM=urxvt
bindkey -s "^x^f" $'emacs '
export VISUAL=$EDITOR
export PATH=$PATH:~/local/bin/:
export CLASSPATH=/usr/local/lib/java:/usr/local/java/lib/junit4.jar
export JAVA_HOME=/usr/lib/jvm/java-6-sun
#this is important for mutt being able to display utf-8 correctly...
export LC_CTYPE=
#setting the MAIL env for ion3
#export MAIL=~/Mail
# left prompt
export PROMPT="%# "
# right promt
export RPROMPT="[%n@%m: %~]"
#from http://jaderholm.com/configs/zshrc
# Global Aliases
alias -g L='|less'
alias -g M='|more'
alias -g G='|grep'
alias -g T='|tail -f'
alias -g H='|head'
alias -g W='|wc -l'
alias -g S='|sort'
LS_COLORS='no=00:fi=00:di=01;34:ln=01;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.gz=01;31:*.bz2=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.avi=01;35:*.fli=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.ogg=01;35:*.mp3=01;35:*.wav=01;35:';
export LS_COLORS
# the big tab completion game:
# Completion, color
#zstyle ':completion:*' completer _complete
autoload -U compinit
compinit
ZLS_COLORS=$LS_COLORS
zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS}
zstyle ':completion:*' list-colors no=00 fi=00 di=01\;34 pi=33 so=01\;35 bd=00\;35 cd=00\;34 or=00\;41 mi=00\;45 ex=01\;32
### Enable advanced completions
zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}'
### General completion technique
zstyle ':completion:*' completer _complete _correct _approximate _prefix
#zstyle ':completion:*' completer _complete _prefix
zstyle ':completion::prefix-1:*' completer _complete
zstyle ':completion:incremental:*' completer _complete _correct
zstyle ':completion:predict:*' completer _complete
# Completion caching
zstyle ':completion::complete:*' use-cache 1
zstyle ':completion::complete:*' cache-path ~/.zsh/cache/$HOST
# Expand partial paths
zstyle ':completion:*' expand 'yes'
zstyle ':completion:*' squeeze-slashes 'yes'
# Don't complete backup files as executables
zstyle ':completion:*:complete:-command-::commands' ignored-patterns '*\~'
# Separate matches into groups
zstyle ':completion:*:matches' group 'yes'
# Describe each match group.
zstyle ':completion:*:descriptions' format "%B---- %d%b"
# Messages/warnings format
zstyle ':completion:*:messages' format '%B%U---- %d%u%b'
zstyle ':completion:*:warnings' format '%B%U---- no match for: %d%u%b'
# Describe options in full
zstyle ':completion:*:options' description 'yes'
zstyle ':completion:*:options' auto-description '%d'
zstyle ':completion:*:history-words' stop yes
zstyle ':completion:*:history-words' remove-all-dups yes
zstyle ':completion:*:history-words' list false
zstyle ':completion:*:history-words' menu yes
# kill
zstyle ':completion:*:*:kill:*:processes' list-colors '=(#b) #([0-9]#)*=0=01;31'
# menu for kill
zstyle ':completion:*:*:kill:*' menu yes select
zstyle ':completion:*:kill:*' force-list always
# kill menu extension!
zstyle ':completion:*:processes' command 'ps --forest -U $(whoami) | sed "/ps/d"'
#zstyle ':completion:*:processes' command 'ps -U $(whoami) | sed "/ps/d"'
#zstyle ':completion:*:*:kill:*:processes' command 'ps --forest -A -o pid,user,cmd'
zstyle ':completion:*:processes' insert-ids menu yes select
# case insensitivity, partial matching, substitution
zstyle ':completion:*' matcher-list 'm:{A-Z}={a-z}' 'm:{a-z}={A-Z}' 'r:|[._-]=** r:|=**' 'l:|=* r:|=*'
# remove uninteresting users
zstyle ':completion:*:*:*:users' ignored-patterns \
adm alias apache at bin cron cyrus daemon ftp games gdm guest \
haldaemon halt mail man messagebus mysql named news nobody nut \
lp operator portage postfix postgres postmaster qmaild qmaill \
qmailp qmailq qmailr qmails shutdown smmsp squid sshd sync \
uucp vpopmail xfs
zstyle ':completion:*' hosts $ssh_hosts
zstyle ':completion:*:my-accounts' users-hosts $my_accounts
zstyle ':completion:*:other-accounts' users-hosts $other_accounts