2 # -*- mode: shell-script -*-
4 # .zshrc - customisations for the all-powerful shell
6 # the latest copy of this file can be found at
7 # http://repose.cx/conf
11 path=(~/.bin ~/Muse /sbin /usr/sbin $path)
16 setopt nobeep # i hate beeps
17 setopt noautomenu # don't cycle completions
18 setopt autocd # change to dirs without cd
19 #setopt autopushd # automatically append dirs to the push/pop list
20 setopt pushdignoredups # and don't duplicate them
21 setopt cdablevars # avoid the need for an explicit $
22 setopt nocheckjobs # don't warn me about bg processes when exiting
23 setopt nohup # and don't kill them, either
24 #setopt listpacked # compact completion lists
25 setopt nolisttypes # show types in completion
26 setopt dvorak # with spelling correction, assume dvorak kb
27 setopt extendedglob # weird & wacky pattern matching - yay zsh!
28 setopt completeinword # not just at the end
29 setopt alwaystoend # when complete from middle, move cursor
30 setopt correct # spelling correction
31 setopt nopromptcr # don't add \n which overwrites cmds with no \n
32 setopt histverify # when using ! cmds, confirm first
33 setopt interactivecomments # escape commands so i can use them later
34 setopt printexitvalue # alert me if something's failed
36 # woo! so glad i found this. jump to each element in a path with m-f m-b, same
40 # history related stuff.
43 export HISTFILE=~/.zsh_history
44 setopt hist_ignore_dups # ignore same commands run twice+
45 setopt appendhistory # don't overwrite history
47 # prompt (if running screen, show window #)
48 if [ x$WINDOW != x ]; then
49 export PS1="%m[$WINDOW]%# "
54 # set up some directory variables. i can then do cd ms to land in my music dir
55 # emacs understands these too.
56 export m=~/Media/music
58 export code=~/Lib/code
59 export work=~/Lib/work
62 # preexec hook shows command in title as it's running, and precmd sets it to
63 # something else when it's done. this should work with screen and
64 # gnome-terminal2/multi-gnome-terminal
69 export CURRENTCMD="$1"
70 if [ x$WINDOW != x ]; then
77 if [[ ! -z $CURRENTCMD ]]; then
78 if [ x$WINDOW != x ]; then
79 print -Pn "\ek($CURRENTCMD)\e\\"
81 print -Pn "\e]0;($CURRENTCMD)\a"
88 # log out all my ephemeral shells, except the last one
92 if [ `pwd` = ~ ] && [ x$WINDOW != x ] && (( $WINDOW != 0 )); then
97 [[ "$WINDOW" = 0 ]] && setopt ignore_eof
99 #trap '(( $WINDOW == 0 )) && echo "Last window - type logout" && return 0' EXIT
101 # this is defined in ~/.bin/e now
103 # i have gnuclient set to load files in my current emacs buffer, so i'd like to
104 # jump to it afterwards. i use a program "e" to edit files in this manner.
106 # sawfish-client -f de-gnuserv-activate > /dev/null
107 # # now run gnuclient. we'll be returned to this window when c-x # is hit in
112 export CVSROOT=~/Lib/CVS
115 # If running interactively, then:
119 alias ls='ls --color=auto'
124 # used to have arch-dependent flags, but i kept forgetting to unset cflags
125 # before compiling stuff for another box. i don't compile much anymore.
126 export CFLAGS="-O2 -fomit-frame-pointer -pipe"
128 export SmallEiffel="/usr/lib/smalleiffel/sys/system.se"
129 export PYTHONPATH="/home/resolve/.python"
130 export PYTHONSTARTUP="/home/resolve/.pystartup"
131 export SAVEDIR="/home/resolve/.news/"
132 export ORGANISATION="Damien Elmes"
134 export TEXINPUTS=::/usr/local/lib/texmf
137 export EDITOR=$VISUAL
139 # colours in man output, emacs like bindings. nifty.
142 # anti aliasing in the two toolkits
146 alias go-wl="sudo ifdown eth0; sudo /etc/init.d/pcmcia start"
147 alias go-eth="sudo /etc/init.d/pcmcia stop; sudo ifup eth0"
148 alias nw="sfsagent resolve@respite; ls .mail > /dev/null 2>&1"
156 # completion tweaking
159 # complete hostnames out of ssh's ~/.ssh/known_hosts
160 autoload -U compinit; compinit
161 zstyle ':completion:*' use-cache on
162 zstyle ':completion:*' users resolve
163 hosts=(${${${${(f)"$(<$HOME/.ssh/known_hosts)"}:#[0-9]*}%%\ *}%%,*})
164 zstyle ':completion:*:hosts' hosts $hosts
166 # use dircolours in completion listings
167 zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS}
169 # allow approximate matching
170 zstyle ':completion:*' completer _complete _match _approximate
171 zstyle ':completion:*:match:*' original only
172 zstyle ':completion:*:approximate:*' max-errors 1 numeric
173 zstyle ':completion:*' auto-description 'Specify: %d'
174 zstyle ':completion:*' format 'Completing %d'
175 zstyle ':completion:*' verbose true
176 zstyle ':completion:*:functions' ignored-patterns '_*'
177 zstyle ':completion:*:*:(^rm):*:*files' ignored-patterns \
178 '*?.(o|c~|zwc)' '*?~'
180 bindkey "\C-w" kill-region
184 # evaluate work related stuff
185 [ -f .workrc ] && . ~/.workrc
187 if [ x$TERM = xscreen ]; then