1 # Rev 10
  2 
  3 
  4 
  5 # ==============================
  6 # Modules
  7 # ==============================
  8 
  9 autoload -U colors   && colors
 10 autoload -U compinit && compinit
 11 
 12 
 13 
 14 # ==============================
 15 # Environment
 16 # ==============================
 17 
 18 export PATH=/opt/jdk1.6.0_24/bin:~/Code/Sensorscope/TinyOS-Images/MainBoard/ScopeTools:~/Code/Perso/X1060/:~/Scripts/:~/Install/ihex2titex/:$PATH
 19 export EDITOR=vim
 20 export BROWSER=google-chrome
 21 
 22 
 23 
 24 # ==============================
 25 # Aliases
 26 # ==============================
 27 
 28 # Regular aliases
 29 alias -r ..='cd ..'
 30 alias -r cd..='cd ..'
 31 alias -r ls='ls -ohq --color --group-directories-first'
 32 alias -r vi='vim'
 33 alias -r rm='rm -i'
 34 alias -r du='du -hSc'
 35 alias -r df='df -h'
 36 alias -r pushd='pushd .'
 37 alias -r diff='diff -Naur'
 38 alias -r eps2pdf='ps2pdf -dEPSCrop'
 39 alias -r term='xterm -fa "Courier New" -fs 10 -bg black -fg white -geometry 170x63+15+10 &'
 40 alias -r xvim='xterm -fa "Courier New" -fs 10 -bg black -fg white -geometry 175x53+15+10 -e vim &'
 41 
 42 # Replace top by htop if it's installed
 43 [[ -x `which htop` ]] && alias -r top='htop'
 44 
 45 
 46 
 47 # ==============================
 48 # General
 49 # ==============================
 50 
 51 # Prompt
 52 PROMPT="%{$fg_bold[green]%}%n@%m%{$reset_color%}:%{$fg_bold[blue]%}%50<..<%~%{$reset_color%}%# "
 53 
 54 # Don't print anything when using pushd/popd
 55 setopt pushdsilent
 56 
 57 # Wait ten seconds before confirmation when executing 'rm *'
 58 setopt rmstarwait
 59 
 60 # Wait before displaying the status of background jobs
 61 setopt nonotify
 62 
 63 # No noise
 64 unsetopt beep
 65 
 66 # Disable core dumps
 67 ulimit -c 0
 68 
 69 
 70 
 71 # ==============================
 72 # History
 73 # ==============================
 74 
 75 # History file
 76 HISTFILE=~/.zsh_history
 77 
 78 # Size of the history file
 79 SAVEHIST=10000
 80 
 81 # Size of the history of the current session
 82 HISTSIZE=10000
 83 
 84 # Immediately appends commands to the history file
 85 setopt incappendhistory
 86 
 87 # Do not save a command if it is a duplicate of the previous one
 88 setopt histignoredups
 89 
 90 
 91 
 92 # ==============================
 93 # Key bindings
 94 # ==============================
 95 
 96 # Up and down arrows
 97 bindkey $terminfo[kcuu1] up-history
 98 bindkey $terminfo[kcud1] down-history
 99 
100 # Delete, backspace, home, end
101 bindkey $terminfo[kdch1] delete-char
102 bindkey $terminfo[kbs]   backward-delete-char
103 bindkey $terminfo[khome] beginning-of-line
104 bindkey $terminfo[kend]  end-of-line
105 
106 # <C-r>: Backward search
107 bindkey ^r history-incremental-search-backward
108 
109 # <C-l>: Clear screen
110 bindkey ^l clear-screen
111 
112 
113 
114 # ==============================
115 # Completion
116 # ==============================
117 
118 # Immediately show all possible completions
119 setopt   autolist
120 unsetopt listambiguous
121 
122 # Offer only matching files upon completion (not even directories) unless there's no matching file
123 zstyle ':completion:*' file-patterns '%p:globbed-files' '*:all-files'
124 
125 # Associate file extensions with commands
126 compdef '_files -g "*.rpm"'                         alien
127 compdef '_files -g "*.dvi"'                         dvips
128 compdef '_files -g "*.bmp *.gif *.jpg *.png"'       eog gimp gthumb
129 compdef '_files -g "*.eps *.pdf *.ps"'              evince
130 compdef '_files -g "*.mp3"'                         eyeD3
131 compdef '_files -g "*.plt"'                         gnuplot gnuplot-tufte
132 compdef '_files -g "*.svg *.svgz"'                  inkscape
133 compdef '_files -g "*.ltx *.tex"'                   latex pdflatex
134 compdef '_files -g "*.avi *.flv *.mov *.mpg *.wmv"' mplayer
135 compdef '_files -g "*.png"'                         optipng
136 compdef '_files -g "*.eps *.ps"'                    ps2pdf