A complete zshrc :-D
# The following lines were added by compinstall
zstyle ':completion:*:descriptions' format '%B%d%b'
zstyle ':completion:*:messages' format '%d'
zstyle ':completion:*:warnings' format 'No matches for: %d'
zstyle ':completion:*' group-name ''
zstyle ':completion:*' group-name ''
zstyle ':completion:*' ignore-parents parent pwd .. directory
zstyle ':completion:*' insert-unambiguous true
zstyle ':completion:*' list-colors ''
zstyle ':completion:*' matcher-list '' 'm:{a-z}={A-Z} m:{a-zA-Z}={A-Za-z}' 'r:|[._-]=** r:|=**' 'l:|=* r:|=*'
zstyle ':completion:*' max-errors 3 numeric
zstyle ':completion:*' menu select=0
zstyle ':completion:*' prompt '%d)'
zstyle ':completion:*' select-prompt '%SScrolling active: current selection at %p%s'
zstyle ':completion:*' use-compctl false
zstyle ':completion:*' verbose yes
# zstyle :compinstall filename '/home/tinou/.zshrc'
zstyle ':exec_on_xclip:*' contexts \
"0:uri_http" 'http://*' \
"1:file_gz" '(/|~)*.gz' \
"2:file" '(/|~)*'
zstyle ':exec_on_xclip:*' stages '0:nox' '1:x11'
zstyle ':exec_on_xclip:*' xclip "xclip"
zstyle ':exec_on_xclip:*' options "-o"
zstyle ':exec_on_xclip:x11:*' operate true
zstyle ':exec_on_xclip:nox:*' clearterm true
if [[ -x $(which firefox) ]] ; then
zstyle ':exec_on_xclip:x11:uri_http' app 'firefox -new-tab _eoxc_'
else
zstyle ':exec_on_xclip:x11:uri_http' app false
fi
zstyle ':completion:*' completer _expand _complete _correct _approximate
autoload -Uz compinit
compinit
# End of lines added by compinstall
autoload promptinit
promptinit
################
# History file #
################
#
# HISTFILE=~/.zsh-history.$ZSH_VERSION
HISTFILE=~/.zsh-history
HISTSIZE=500
SAVEHIST=50000
setopt hist_ignore_all_dups hist_reduce_blanks \
hist_save_no_dups inc_append_history \
extended_history share_history multios
# setopt hist_ignore_all_dups hist_reduce_blanks \
WATCH=all
LOGCHECK=20
###############
# Environment #
###############
export PATH=$PATH:/sbin:/usr/sbin:/home/tinou/hack/scripts
export EDITOR="vim"
export SHELL=/bin/zsh
###########
# Aliases #
###########
alias ls='ls --color=auto -F'
alias v='ls -l'
alias ll='ls -hl'
alias la='ls -hla'
alias fc='fc -e vim'
alias hash='hash -v'
alias aafire='aafire -driver slang'
alias fire='aafire'
alias vi='vim'
alias xvim='xvim.sh'
alias xvi='xvim'
alias grub='grub-install hd0'
alias emerge='emerge -va'
alias unmerge='emerge -C'
alias unemerge=unmerge
# alias man='man -P "less -si"'
# alias cp='cp -g'
# alias mv='mv -g'
alias ne='emacs'
alias startx='startx |& tee xlog'
alias ftp='tnftp'
# alias gvim='gvim -p --remote-tab-silent'
alias :q='logout'
alias :q!='logout'
alias getmail='touch /home/tinou/mail/mbox-gmail && getmail'
alias s='screen -d -R'
alias m='pilot-mailsync.sh'
alias pm=m
alias z='xtrlock & ; xset dpms force suspend'
alias mz=z
#alias hothead="grep -B3 '^Subject' mail/mbox"
#alias ghead="grep -B3 '^Subject' mail/mbox-gmail"
alias hothead="sed -n '/^From:/,/^Subject:/p' mail/mbox | sed 's/^Subject:\(.*\)$/Subject:\1\n--/'"
alias ghead="sed -n '/^From:/,/^Subject:/p' mail/mbox-gmail | sed 's/^Subject:\(.*\)$/Subject:\1\n--/'"
alias vumeter='meterbridge -t vu alsa_pcm:playback_2 alsa_pcm:playback_1'
alias ssu='screen -t root su'
alias svim='screen -t vim vim'
alias svi=svim
alias sman='screen -t man man'
alias cscope='cscope -R'
alias fur='Fur ~/mobile_htc'
alias unfur='fusermount -u ~/mobile_htc'
alias amule='amule --even-if-lfroen-complains-this-will-stay'
alias sel='sselp'
alias mpc='pmpc'
alias tty12="cat /dev/vcs12 | sed -n 's/\(.\{128\}\)/\1\n/gp'"
alias sudo='sudo -H'
#############
# Functions #
#############
# /home/tinou/hack/scripts/wt \
# "Terminal <`cat /tmp/$UID.iceTerms 2>&-`> (zsh:$$)" 2>&-
function preexec(){
chpwd
lastcmd=$1
if [ "$TERM" != "linux" ]; then
# echo -n "\033]0;$USER@$HOST $PWD $1\007"
#echo -n "\033]0;$USER@$HOST> $lastcmd ; $PWD\007"
echo -n "\033]0;$USER@$HOST> $lastcmd\007"
#wt "$USER@$HOST> $lastcmd ; $PWD"
# wt "$lastcmd ; $USER@$HOST:$PWD" 2>&-
# /home/tinou/hack/python/setTitle.py "\e]2;% %n@%m: %~\a"
fi
}
#function precmd() {
#[[ -t 1 ]] || return
#case $TERM in
#sun-cmd) print -Pn "\e]l%~\e\\"
#;;
#*xterm*|rxvt|(dt|k|E)term) print -Pn "\e]2;% zsh $$ %n@%m> %~\a"
#echo -n "\033]0;$USER@$HOST> $PWD\007"
#;;
#esac
#}
function precmd() {
[[ -t 1 ]] || return
if [ "$TERM" != "linux" ]; then
#echo -n "\033]0;$USER@$HOST> $PWD\007"
echo -n "\033]0;$USER@$HOST>\007"
#wt "$USER@$HOST> $PWD"
fi
}
## faq 3.6 how do i automatically display the directory in my xterm title bar?
## http://zsh.sourceforge.net/faq/zshfaq03.html#l22
##
## i modified the xterm version because it was too plain.
chpwd() {
[[ -t 1 ]] || return
case $term in
sun-cmd) print -pn "\e]l%~\e\\"
;;
#*xterm*|rxvt|(dt|a|k|e)term) print -Pn "\e]2;% %n@%m: %~\a"
*xterm*|rxvt|(dt|a|k|e)term) /home/tinou/hack/python/setTitle.py "%n@%m>\e]2 ; %~\a"
;;
esac
}
################
# Key Bindings #
################
# To discover the proper keys, in vi mode type: ^v then the key
bindkey '^[[3~' delete-char
bindkey '^[[7~' beginning-of-line
bindkey '^[[8~' end-of-line
# xterm
bindkey '^[[H' beginning-of-line
bindkey '^[[F' end-of-line
# gnome-terminal
bindkey '*OH' beginning-of-line
bindkey '*OF' end-of-line
# screen
bindkey '*[1~' beginning-of-line
bindkey '*[4~' end-of-line
# pg up and pg down
bindkey '*[5~' up-history
bindkey '*[6~' down-history
bindkey -v
#autoload -U exec_on_xclip
#zle -N exec_on_xclip
#bindkey '*' exec_on_xclip
##########################################################
# from Flouf
##########################################################
# PS1=$'%h %{\e[22;44m%}%n@%m%{\e[00m%} %# %{\e[00m%}'
### Use cache
## Some functions, like _apt and _dpkg, are very slow. You can use a cache in
## order to proxy the list of results (like the list of available debian
## packages)
zstyle ':completion:*' use-cache on
zstyle ':completion:*' cache-path ~/.zsh/cache
## Prevent CVS files/directories from being completed
zstyle ':completion:*:(all-|)files' ignored-patterns '(|*/)CVS'
zstyle ':completion:*:cd:*' ignored-patterns '(*/)#CVS'
## I use dvorak, so correct spelling mistakes that a dvorak user would make
setopt dvorak
## Extended history.
## Instead of just a list of commands, append it with this:
## ':<beginning time since epoch>:<elapsed seconds>:<command>'.
setopt extended_history
## Automatically append directories to the push/pop list
setopt auto_pushd
## Maximum size of the directory stack
DIRSTACKSIZE=50
## From resolve's config (http://repose.cx/conf/.zshrc)
setopt extended_glob # Weird & wacky pattern matching - yay zsh!
setopt complete_in_word # Not just at the end
setopt always_to_end # When complete from middle, move cursor
setopt correct # Spelling correction
# setopt hist_verify # When using ! cmds, confirm first
setopt interactive_comments # Escape commands so I can use them later
setopt print_exit_value # Alert me if something's failed
## Anti-aliasing in the two toolkits
## Use this type of assignment to set the variable if not already set
(( ${+QT_XFT} )) || export QT_XFT=1
(( ${+GDK_USE_XFT} )) || export GDK_USE_XFT=1
##########################################################
prompt walters
if [ "$SUDO_USER" = "tinou" ]; then
export XAUTHORITY=/tmp/screen.auth.tinou
export DISPLAY=:0.0
fi