# (( ${+*} )) = if variable is set don't set it anymore
# Note: Do *not* use '$PORTSDIR'! This variable is defined in
# '/path/to/ports/Makefile'.
(( ${+IRCNAME} )) || export IRCNAME="Christian 'strcat' Schneider" # **EDIT**
(( ${+IRCNICK} )) || export IRCNICK="strcat" # **EDIT**
(( ${+IRCSERVER} )) || export IRCSERVER="irc.euirc.net" # **EDIT**
(( ${+VISUAL} )) || export VISUAL="vim" # **EDIT**
(( ${+BROWSER} )) || export BROWSER="w3m" # **EDIT**
(( ${+OS} )) || export OS="${OSTYPE%%[0-9.]*}" # **FIXME**
(( ${+OSMAJOR} )) || export OSMAJOR="${OSVERSION%%.*}" # **FIXME**
(( ${+ORGANIZATION} )) || export ORGANIZATION="Guerrilla UNIX Development (Venimus, Vidimus, Dolavimus)" # **EDIT**
(( ${+SHITDIR} )) || export SHITDIR="$HOME/Trash"
#(( ${+TERM} )) || export TERM=xterm16-256cterm
(( ${+TERM} )) || export TERM=xterm-256color
(( ${+LESSCHARSET} )) || export LESSCHARSET=utf-8
# Warn on lack of 256 color support from termcap/info.
(test -n "$(tput Co 2>/dev/null)" \
&& test "$(tput Co 2>/dev/null)" -eq 256) \
|| (test -n "$(tput colors 2>/dev/null)" \
&& test "$(tput colors 2>/dev/null)" -eq 256) \
|| echo "WARNING: 256 color terminal not set correctly!"
#--------------------------------------------------
# # Initialisation for new style completion.
# if [[ $ZSH_VERSION > '4.2' ]]; then
# autoload -U compinit
# compinit
# else
# print "Advanced completion system not found; ignoring zstyle settings."
# function zstyle { }
# fi
#
#--------------------------------------------------
# Git
if [[ -x `which git` ]]; then
(( ${+GIT_AUTHOR_EMAIL} )) || export GIT_AUTHOR_EMAIL="strcat@gulli.com"
(( ${+GIT_AUTHOR_NAME} )) || export GIT_AUTHOR_NAME="Christian Schneider"
(( ${+GIT_COMMITTER_EMAIL} )) ||export GIT_COMMITTER_EMAIL=$GIT_AUTHOR_EMAIL
fi
# Darcs
if [[ -x `which darcs` ]]; then
(( ${+DARCS_DONT_ESCAPE_EXTRA} )) || export DARCS_DONT_ESCAPE_EXTRA="áéíóúñÁÉÍÓÚÑ"
(( ${+DARCS_EDITOR} )) || export DARCS_EDITOR="vim"
(( ${DARCS_EMAIL} )) || export DARCS_EMAIL=darcs@strcat.de
fi
# HTML-Tidy
if [[ -x `which tidy` ]]; then
(( ${+HTML_TIDY} )) || export HTML_TIDY=${HOME}/.tidyrc
fi
# Needed for Perl.. i think so!?
#export PERL_UTF8_LOCALE=1 PERL_UNICODE=AS
# To stop Perl interpreters not configured to expect a Unicode locale:
export PERL_BADLANG=0
# Fucking PERL5LIB *narf*
if [[ -d "~/local" ]]; then
typeset -U perl5lib
export PERL5LIB
perl5lib=(
~/{local/,}lib/[p]erl5{,/site_perl}(N)
$perl5lib
)
PERL5LIB="${(j/:/)perl5lib}"
fi
# his will start new tmux session if you connect remotely; if you want
# to suppress it, just use "TERM=screen ssh user@host" and reset your
# $TERM back to xterm, or launch screen/tmux on local host.
#--------------------------------------------------
# if [ -z "$TMUX" ] && [ $TERM != "screen" ]; then
# tmux -2 -u -l -d
# [ $? -eq 0 ] && exit
# echo "WARNING: tmux exited with an error!" >&2
# fi
#--------------------------------------------------
# If we're already in screen or not on ssh connection (local access),
# don't run the rest of the code (shell is secure)
if [[ "$TERM" != "screen" ]] && [[ -n "$SSH_CONNECTION" ]]; then
if `which tmux`; then
if tmux -q has-session -t $tmux_session 2> /dev/null ; then
tmux -q attach-session -t $tmux_session
else
tmux -q new-session -s $tmux_session
fi
fi
fi
# Available or not?
if [[ -x `which lesspipe.sh` ]]; then
export LESSOPEN='|lesspipe.sh %s' # **EDIT**
fi
# This one is needed for FreeBSD because OSVERSION is defined in
# /usr/ports/Mk/bsd.port.mk. Thx to Christian Mondabon for this "bugreport".
if [ `uname -s` = "FreeBSD" ]; then
export OSVERSION="`/sbin/sysctl -n kern.osreldate`"
else
(( ${+OSVERSION} )) || export OSVERSION="${OSTYPE#$OS}" # **FIXME**
fi
# OpenBSD and CRUX are evil ;)
# allow me to cd directly into a dir in $PORTS_DIR from anywhere
# $ cd shells && pwd
# /usr/ports/shells
if [ -d "/usr/ports" ]; then
(( ${+PORTS_DIR} )) || export PORTS_DIR="/usr/ports" # {Free,Open}BSD
fi
if [ -d "/usr/pkgsrc" ]; then
(( ${+PORTS_DIR} )) || export PORTS_DIR="/usr/pkgsrc" # NetBSD
fi
if [ -d "/usr/portage" ]; then
(( ${+PORTS_DIR} )) || export PORTS_DIR="/usr/portage" # My LFS
fi
# use tor () to aonymizing overlay network for TCP
# in combination with privoxy () for a web proxy
# with advanced filtering capabilities for protecting privacy against
# internet junk.
if [ -x $(which tor 1&>/dev/null) ] && [ -e /usr/sbin/privoxy ]; then
# The most commandline-applications (w3m, ssh, ftp, ..) use the
# variable ``HTTP_PROXY'' to connect with a proxy
(( ${+HTTP_PROXY} )) || export HTTP_PROXY="http://127.0.0.1:8118/"
# The *most*(!) but not all .. lynx .. the default-browser on
# OpenBSD (Yes! I use lynx very often on my workstations)
(( ${+http_proxy} )) || http_proxy="http://127.0.0.1:8118/"
fi
# some variables for specific systems. I *don't* use FreeBSD so i've no
# variables for this.
case ${OS} in
openbsd)
(( ${+CVSROOT} )) || export CVSROOT="anoncvs@mirror.osn.de:/cvs"
(( ${+PKG_PATH} )) || export PKG_PATH="http://artfiles.org/openbsd/4.4/packages/i386"
#(( ${+PKG_PATH} )) || export PKG_PATH="ftp://ftp.freenet.de/pub/ftp.openbsd.org/pub/OpenBSD/$(uname -r)/packages/$(uname -m)/"
#(( ${+PKG_PATH} )) || export PKG_PATH="ftp://openbsd.ftp.fu-berlin.de/pub/OpenBSD/$(uname -r)/packages/$(uname -m)/"
export TERM=xterm
;;
netbsd*)
(( ${+PKG_PATH} )) || export PKG_PATH="ftp://ftp.netbsd.org/pub/NetBSD/packages/$(uname -r)/i386/All/"
(( ${+CVSROOT} )) || export CVSROOT="anoncvs@anoncvs.se.netbsd.org:/cvsroot"
(( ${+LD_LIBRARY_PATH} )) || export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:/usr/X11R6/lib:/usr/local/lib:/usr/pkg/lib"
(( ${+INCLUDEPATH} )) || export INCLUDEPATH="$INCLUDEPATH:/usr/local/lib"
(( ${+CFLAGS} )) || export CFLAGS='-I/usr/local/include -I/usr/pkg/include -I/usr/X11R6/include'
(( ${+CPPFLAGS} )) || export CPPFLAGS=$CFLAGS
;;
esac
# Set the values for some environment variables:
# NOTE: The utiliti ``hostname'' is *not* included on all systems
# because it's not part of IEEE Std 1003.1, 2004 Edition!
export HOSTNAME="`hostname`"
# Some (useful) options for less
if [[ -x `which less` ]] ; then
export PAGER="less"
export PERLDOC_PAGER="less -+C -E"
export LESS="-R -C -i -j4 -M -e -PM?m(%i/%m) .?f%f:Standard input.\: ?bb%bb?B/%B. Bytes.?pb (%pb\%).?lb, Zeile\: %lb?e ?x(-> %x):(EOF).%t"
# export LESS='-rX~deMwPM?f%f ?e[EOF] ?lt[Line\: %lb].:?lt[Line\: %lt]. ?pt%pt\%...'
export LESSBINFMT='*u[%X]'
if [[ $terminfo[colors] -ge 8 ]] ; then
export LESS_TERMCAP_mb=$'\E[01;31m'
export LESS_TERMCAP_md=$'\E[01;31m'
export LESS_TERMCAP_me=$'\E[0m'
export LESS_TERMCAP_se=$'\E[0m'
export LESS_TERMCAP_so=$'\E[01;44;33m'
export LESS_TERMCAP_ue=$'\E[0m'
export LESS_TERMCAP_us=$'\E[01;32m'
fi
else
export PAGER="more"
fi
# NOTE: This newsserver is *only* for T-Online user!
export NNTPSERVER='news.t-online.com'
# just for fun ..
export ZVERSION=${VERSION:-"zsh $ZSH_VERSION"}
# the default homepage for lynx
export WWW_HOME="http://www.google.com"
export HTTP_HOME="http://www.google.com"
# The ultimate old-school single player dungeon exploration game!!!111!
export NETHACKOPTIONS='gender:male,noautopickup,color,lit_corridor,showrace,showexp,showdmg,showweight,time,toptenwin,catname:Prowl,msg_window:f,!legacy'
# this value is optional because CRUX has no info-pages
typeset -U infopath # no duplicates
export INFOPATH="/usr/share/info:/usr/share/binutils-data/i686-pc-linux-gnu/2.16.1/info:/usr/share/gcc-data/i686-pc-linux-gnu/3.4.5/info/"
# export INFOPATH="/usr/local/info/:/usr/share/info/:/usr/local/emul/redhat/:/usr/share/info/"
# default encrypted session via rsync
export RSYNC_RSH=ssh
# Do *not* use RSH! RSH sucks!!!11!
export CVS_RSH=ssh
# its the same as ``-rwxrwxr-x''
export CVSUMASK=003
# use ``CVSEDITOR=emacs'' if u want to use a complete OS :>
export CVSEDITOR=vim
# Needed for some functions (bm, bmls, bmadd, ..)
if [ ! -e ${HOME}/.bmrc ]; then
export BMRC=~/.bmrc
touch $BMRC
fi
# Some settings for the manpages
# set the width to 80. Its enough
export MANWIDTH=80
if [[ -x $(which most) ]]; then
export MANPAGER="most"
else
export MANPAGER="less -iMXF"
# use colors when browsing man pages (if not using pinfo or PAGER=most)
[[ -d ~/.terminfo/ ]] && alias man='TERMINFO=~/.terminfo/ LESS=C TERM=mostlike PAGER=less man'
fi
# ``C'' for Debian (my niece use my zsh setup too ^^) and NetBSD,
# ``POSIX'' for OpenBSD (it doesn't support locale(P),
# ``en_US.iso88591'` for Slackware and ``en_US'' for my linuxbox (LFS).
# Dont ask me why. Use it or not.
if [ -e "/etc/debian_version" ]; then
export LANG="en_US.UTF-8"
export DEBCHANGE_AUTO_NMU=no
export DEBCHANGE_RELEASE_HEURISTIC=changelog
export DEBCOMMIT_SIGN_TAGS=yes
export DEBFULLNAME="Christian (strcat) Schneider"
export DEBEMAIL="debian@strcat.de"
export DEBSIGN_KEYID="0x47E322CE"
export DEBUILD_DPKG_BUILDPACKAGE_OPTS="-i -ICVS -I.svn"
export DEBSIGN_SIGNLIKE=gpg
else
case ${OS} in
linux*)
export LANG="en_US"
;;
netbsd*)
export LANG="C"
;;
openbsd*)
export LANG=POSIX
esac
fi
# i primarily use Vim (GNU Emacs and jed are only exception ;-))
# $ print ${${$(=vim --version)[5]}:gs/.//}
# is equivalent to
# $ /path/to/vim --version | head -n 1 | awk '{print $5}' | sed 's/\.//'
if [[ -x `which vim` ]]; then
export EDITOR=vim
export VISUAL="${EDITOR}"
export VIMRELEASE="`print ${${$(vim --version)[5]}:gs/.//}`"
else
if [ -x $(which vi) ]; then
# Yes. VI *is* standard in IEEE Std 1003.1, 2004 Edition!
export EDITOR=vi
fi
fi
case ${OS} in
openbsd)
[ -d "/usr/local/share/vim/vim$VIMRELEASE" ] \
&& export VIMRUNTIME="/usr/local/share/vim/vim$VIMRELEASE"
;;
netbsd*)
[ -d "/usr/pkg/share/vim/vim$VIMRELEASE" ] \
&& export VIMRUNTIME="/usr/pkg/share/vim/vim$VIMRELEASE"
;;
linux-gnu)
if [ -d "/usr/share/vim/vim$VIMRELEASE" ] ; then
export VIMRUNTIME="/usr/share/vim/vim$VIMRELEASE"
else
# that's for CRUX
export VIMRUNTIME="/usr/share/vim"
fi
;;
esac
# $ cd /usr/ports/misc/fileutils
# $ make install clean
# di = directory
# fi = file
# ln = symbolic link
# pi = fifo file
# so = socket file
# bd = block (buffered) special file (block device)
# cd = character (unbuffered) special file (character device)
# or = symbolic link pointing to a non-existent file (orphan)
# mi = non-existent file pointed to by a symbolic link (visible when you type ls -l)
# ex = file which is executable (ie. has 'x' set in permissions (executable)).
#
# 0 = default color 1 = bold
# 4 = underlined 5 = flashing text
# 7 = reverse field 31 = red
# 32 = green 33 = orange
# 34 = blue 35 = purple
# 36 = cyan 37 = grey
# 40 = black background 41 = red background
# 42 = green background 43 = orange background
# 44 = blue background 45 = purple background
# 46 = cyan background 47 = grey background
# 90 = dark grey 91 = light red
# 92 = light green 93 = yellow
# 94 = light blue 95 = light purple
# 96 = turquoise 100 = dark grey background
# 101 = light red background 102 = light green background
# 103 = yellow background 104 = light blue background
# 105 = light purple background 106 = turquoise background
#
# Attribute codes:
# 00 none
# 01 bold
# 02 faint 22 normal
# 03 standout 23 no-standout
# 04 underline 24 no-underline
# 05 blink 25 no-blink
# 07 reverse 27 no-reverse
# 08 conceal
#
# export LS_COLORS="fi=36:di=32:ln=1;33:ec=\\e[0;37m:ex=1:mi=1;30:or=1;30:*.c=32:*.bz=32:*.txt=36;1:*.doc=37:*.zip=1;32:*.rar=1;32:*.lzh=1;32:*.lha=1;32:*.arj=1;32:*.tar=1;32:*.tgz=1;32:*.gz=1;32:*~=1;30:*.bak=1;30:*.jpg=1;35:*.gif=1;35:*.tif=1;35:*.tiff=1;35:*.mod=1;31:*.voc=1;31:*.smp=1;31:*.au=1;31:*.wav=1;31:*.s3m=1;31:*.xm=1;31:*.pl=1;33:*.c=1;33"
LS_COLORS=''
LS_COLORS=$LS_COLORS:'no=0' # Normal text = Default foreground
LS_COLORS=$LS_COLORS:'fi=0' # Regular file = Default foreground
LS_COLORS=$LS_COLORS:'di=32' # Directory = Bold, Yellow
LS_COLORS=$LS_COLORS:'ln=01;36' # Symbolic link = Bold, Cyan
LS_COLORS=$LS_COLORS:'pi=33' # Named pipe = Yellow
LS_COLORS=$LS_COLORS:'so=01;35' # Socket = Bold, Magenta
eS_COLORS=$LS_COLORS:'do=01;35' # DO = Bold, Magenta
LS_COLORS=$LS_COLORS:'bd=01;37' # Block device = Bold, Grey
LS_COLORS=$LS_COLORS:'cd=01;37' # Character device = Bold, Grey
LS_COLORS=$LS_COLORS:'ex=35' # Executable file = Light, Blue
LS_COLORS=$LS_COLORS:'*FAQ=31;7' # FAQs = Foreground Red, Background Black
LS_COLORS=$LS_COLORS:'*README=31;7' # READMEs = Foreground Red, Background Black
LS_COLORS=$LS_COLORS:'*INSTALL=31;7' # INSTALLs = Foreground Red, Background Black
LS_COLORS=$LS_COLORS:'*.sh=47;31' # Shell-Scripts = Foreground White, Background Red
LS_COLORS=$LS_COLORS:'*.vim=35' # Vim-"Scripts" = Purple
LS_COLORS=$LS_COLORS:'*.torrent=4;33' # Torrents = Orange, Underline
LS_COLORS=$LS_COLORS:'*.swp=00;44;37' # Swapfiles (Vim) = Foreground Blue, Background White
LS_COLORS=$LS_COLORS:'*.sl=30;33' # Slang-Scripts = Yellow
LS_COLORS=$LS_COLORS:'*,v=5;34;93' # Versioncontrols = Bold, Yellow
LS_COLORS=$LS_COLORS:'or=01;05;31' # Orphaned link = Bold, Red, Flashing
LS_COLORS=$LS_COLORS:'*.c=1;33' # Sources = Bold, Yellow
LS_COLORS=$LS_COLORS:'*.C=1;33' # Sources = Bold, Yellow
LS_COLORS=$LS_COLORS:'*.h=1;33' # Sources = Bold, Yellow
LS_COLORS=$LS_COLORS:'*.cc=1;33' # Sources = Bold, Yellow
LS_COLORS=$LS_COLORS:'*.awk=1;33' # Sources = Bold, Yellow
LS_COLORS=$LS_COLORS:'*.pl=1;33' # Sources = Bold, Yellow
LS_COLORS=$LS_COLORS:'*.jpg=1;32' # Images = Bold, Green
LS_COLORS=$LS_COLORS:'*.jpeg=1;32' # Images = Bold, Green
LS_COLORS=$LS_COLORS:'*.JPG=1;32' # Images = Bold, Green
LS_COLORS=$LS_COLORS:'*.gif=1;32' # Images = Bold, Green
LS_COLORS=$LS_COLORS:'*.png=1;32' # Images = Bold, Green
LS_COLORS=$LS_COLORS:'*.jpeg=1;32' # Images = Bold, Green
LS_COLORS=$LS_COLORS:'*.ppm=1;32' # Images = Bold, Green
LS_COLORS=$LS_COLORS:'*.pgm=1;32' # Images = Bold, Green
LS_COLORS=$LS_COLORS:'*.pbm=1;32' # Images = Bold, Green
LS_COLORS=$LS_COLORS:'*.tar=31' # Archive = Red
LS_COLORS=$LS_COLORS:'*.tgz=31' # Archive = Red
LS_COLORS=$LS_COLORS:'*.gz=31' # Archive = Red
LS_COLORS=$LS_COLORS:'*.zip=31' # Archive = Red
LS_COLORS=$LS_COLORS:'*.sit=31' # Archive = Red
LS_COLORS=$LS_COLORS:'*.lha=31' # Archive = Red
LS_COLORS=$LS_COLORS:'*.lzh=31' # Archive = Red
LS_COLORS=$LS_COLORS:'*.arj=31' # Archive = Red
LS_COLORS=$LS_COLORS:'*.bz2=31' # Archive = Red
LS_COLORS=$LS_COLORS:'*.html=36' # HTML = Cyan
LS_COLORS=$LS_COLORS:'*.htm=1;34' # HTML = Bold, Blue
LS_COLORS=$LS_COLORS:'*.php=1;45' # PHP = White, Cyan
LS_COLORS=$LS_COLORS:'*.doc=1;34' # MS-Word *lol* = Bold, Blue
LS_COLORS=$LS_COLORS:'*.txt=1;34' # Plain/Text = Bold, Blue
LS_COLORS=$LS_COLORS:'*.o=1;36' # Object-Files = Bold, Cyan
LS_COLORS=$LS_COLORS:'*.a=1;36' # Shared-libs = Bold, Cyan
LS_COLORS=$LS_COLORS:'*.pdf=1,29' # PDF = Whitegrey, Bold
export LS_COLORS
# The format of login / logout reports if the watch parameter is set.
# Default is `%n has %a %l from %m'.
# Recognizes the following escape sequences:
# %n = name of the user that logged in/out.
# %a = observed action, i.e. "logged on" or "logged off".
# %l = line (tty) the user is logged in on.
# %M = full hostname of the remote host.
# %m = hostname up to the first `.'.
# %t or %@ = time, in 12-hour, am/pm format.
# %w = date in `day-dd' format.
# %W = date in `mm/dd/yy' format.
# %D = date in `yy-mm-dd' format.
# WATCHFMT='%n %a %l from %m at %t.'
# WATCHFMT='*knock* *knock* Follow the white rabbit => %n %a %l from %m at %t.'
# WATCHFTM=print '\e[1;35m%B[%b\e[1;32m%B%n%b\e[1;35m%B]%b \e[1;34m%U%a%u \e[1;35mfrom terminal \e[1;31m%M \e[1;35mat \e[1;33m%U%T%u\e[0m''
#WATCHFMT="[%B%t%b] %B%n%b has %a %B%l%b from %B%M%b"
WATCHFMT="%B->%b %n has just %a %(l:tty%l:%U-Ghost-%u)%(m: from %m:)"
# If this parameter is nonzero, the shell will receive an ALRM signal if a
# command is not entered within the specified number of seconds after issuing a
# prompt. If there is a trap on SIGALRM, it will be executed and a new alarm is
# scheduled using the value of the TMOUT parameter after executing the trap.
#TMOUT=1800
# format of process time reports with 'time'
# %% A `%'.
# %U CPU seconds spent in user mode.
# %S CPU seconds spent in kernel mode.
# %E Elapsed time in seconds.
# %P The CPU percentage, computed as (%U+%S)/%E.
# %J The name of this job.
# Default is:
# %E real %U user %S system %P %J
TIMEFMT="\
The name of this job. : %J
CPU seconds spent in user mode. : %U
CPU seconds spent in kernel mode. : %S
Elapsed time in seconds. : %E
The CPU percentage. : %P"
#--------------------------------------------------
# TIMEFMT="Real: %E User: %U System: %S Percent: %P Cmd: %J"
#--------------------------------------------------
# The maximum number of events stored in the internal history list. If you use
# the HIST_EXPIRE_DUPS_FIRST option, setting this value larger than the
# SAVEHIST size will give you the difference as a cushion for saving
# duplicated history events.
HISTSIZE=100000
# Stop annoying MailChecks. I'm not using AOL
unset MAILCHECK
# The name of the file used to store command history. When assigned to, history
# is loaded from the specified file. Also, several invocations of the shell
# running on the same machine will share history if their HISTFILE parameters
# all point to the same file.
# i have finally discovered the difference between `SAVEHIST' and `HISTSIZE'
# thanks to the FAQ. `HISTSIZE' is the number of lines of history that is
# kept within any given, running zsh. `SAVEHIST' is the number of lines of
# history that is written out to a file at the magic, mysterious moment
# when that event occurs. so cat-ing `HISTFILE' into wc -l should enumerate
# the number of history events
if (( ! EUID )); then
HISTFILE=~/.root_histfile
else
HISTFILE=~/.zsh_history
fi
#HISTFILE=$HOME/.zsh_history
SAVEHIST=65536
DIRSTACKSIZE=50
# If nonnegative, commands whose combined user and system execution
# times (measured in seconds) are greater than this value have timing
# statistics printed for them.
REPORTTIME=60
# Limit this fuckung "zsh: do you wish to see all NNN possibilities (NNN
# lines)?" downward (default is 100). Only ask before displaying
# completions if doing so would scroll.
LISTMAX=0
# Seconds for login / logout check
LOGCHECK=20
# Define some ftp-hosts ($ ftp )
hosts=( ftp.{free,open,net}bsd.org
ftp rtfm.mit.edu
ftp.leo.org
ftp.2600.com
ftp.ciac.llnl.gov
ftp.de.kernel.org
ftp.mitglied.lycos.de
ftp.strcat.neessen.net
ftp.strcat.de
ftp.revier.com
strcat.isa-geek.org
shell.sf.net
127.0.0.1
192.168.1.{1..9}
)
zstyle ':completion:*:*:(zfanon|ftp):*' hosts $hosts
# Set the default system $PATH:
# PATH="/usr/sbin:/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/usr/games:/"
#PATH="/sbin:/usr/sbin:/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/usr/games:/home/dope/bin:/"
#for foo in ~/bin ~/progs/bin; do
# if [[ -z ${path[(r)$dir]} ]]; then
# path=($dir $path)
# fi
#done
# /Default/-PATH
PATH="/bin:/sbin:/usr/bin:/usr/sbin"
# If ~/bin exist, add it to $PATH (~/bin contains some scripts, ..)
[ -d "${HOME}/bin" ] && PATH="${PATH}:${HOME}/bin"
# Same here, but ~/dev-bin contains "unstable" software (WMI, Zsh, GCC,
# ..)
[ -d "${HOME}/dev-bin" ] && PATH="${PATH}:${HOME}/dev-bin/bin"
[ -d "${HOME}/dev-bin" ] && PATH="${PATH}:${HOME}/dev-bin/sbin"
# Check some directories and add existing to $PATH
for dir in \
/usr/local/bin \
/usr/local/sbin \
/usr/dietlibc/bin \
/usr/X11R6/bin \
/usr/share/texmf/bin \
/usr/X11R6/libexec/fvwm/2.4.16 \
/usr/lib/java/bin \
/var/qmail/bin \
/usr/pkg/bin \
/usr/pkg/sbin \
/usr/lib/gentoolkit/bin \
/home/dope/dev-bin/9/bin \
/opt/ati/bin \
/opt/Acrobat7 \
/usr/games \
/usr/games/bin \
/cygdrive/c/WINDOWS/system32 \
/cygdrive/c/WINDOWS \
/cygdrive/c/WINDOWS/System32/Wbem
do
[ -d "${dir}" ] && PATH="${PATH}:${dir}"
done
# For root users, ensure that /usr/local/sbin, /usr/sbin, and /sbin are in
if (( EUID == 0 )); then
echo $PATH | grep /usr/local/sbin 1> /dev/null 2> /dev/null
if [ ! $? = 0 ]; then
PATH=/usr/local/sbin:/usr/sbin:/sbin:$PATH
fi
fi
# if your compdef Dir is ~/.zsh
if [ -d "${HOME}/.zsh/func" ]; then
fpath=( $fpath ~/.zsh/func )
autoload -U ~/.zsh/func/*(:t)
fi
# An array (colon-separated list) of directories specifying the
# search path for the cd command.
CDPATH="$PORTS_DIR"
# See for details.
if autoload +X -U _accept_line_with_url > /dev/null 2>&1 ; then
zle -N accept-line-with-url _accept_line_with_url
bindkey '^M' accept-line-with-url
bindkey '^J' accept-line-with-url
export DOWNLOADER="wget -S -c"
fi
# Using a /X11-Browser/ when X11 is up
if [ $DISPLAY ]; then
export WWW_BROWSER="/home/dope/bin/url_handler.sh %s"
export RAGGLE_BROWSER="/home/dope/bin/url_handler.sh"
else
export WWW_BROWSER=${BROWSER:-lynx}
fi
if [ "$DISPLAY" = "screen" ]; then
stty erase '^?'
fi
# Clean the non-existing dirs from my $PATH before export $PATH
# ,----[ It's evil.. isn't it? ]
# | [dope@dreckskind:~]% PATH=/bin:/usr/games:/bin
# | [dope@dreckskind:~]% echo $PATH
# | /bin:/usr/games:/bin
# | [dope@dreckskind:~]% path=($^path(N))
# | [dope@dreckskind:~]% echo $PATH
# | /bin:/usr/games
# | [dope@dreckskind:~]%
# `----
#path=($^path(N))
#export PATH
# automatically remove duplicates from these arrays
typeset -gU path cdpath manpath fpath
# RTFM!!!11!
MANPATH="/usr/share/man:/usr/local/man"
for mdir in \
${HOME}/.Documentations/manpages.de \
/usr/man \
${HOME}/dev-bin/man \
/var/qmail/man \
/usr/X11/man \
/usr/X11R6/man \
/usr/share/texmf/man \
/usr/contrib/man \
/usr/share/man/old
do
[ -d "${mdir}" ] && MANPATH="${MANPATH}:${mdir}"
done
# notices on new mails .. hey .. i'm not using AOL ;)
#--------------------------------------------------
# mailpref=/home/dope/MuttMail
# mailpath=($mailpref/INBOX'?New Mail in your INBOX'
# $mailpref/Cron'?New Mail from Cron')
#--------------------------------------------------
#--------------------------------------------------
# typeset -a mailpath
# for i in ~/MuttMail/**/new; do
# mailpath[$#mailpath+1]="${i}?You have new mail in ${i:h}."
# done
#--------------------------------------------------
# PS{1,2,3}, RPOMPT, ..
# The "prompt" of the shell.
# See zshmisc(1) (/PROMPT EXPANSION) for details.
#
# %n $USERNAME.
# @ literal '@'
# %m machine name.
# %M The full machine hostname.
# %% %
# %/ Present working directory ($PWD) (i. e.: /home/$USERNAME)
# %~ Present working directory ($PWD) (i. e.: ~)
# %h Current history event number.
# %! Current history event number.
# %L The current value of $SHLVL.
# %S (%s) Start (stop) standout mode.
# %U (%u) Start (stop) underline mode.
# %B (%b) Start (stop) boldface mode.
# %t / %@ Current time of day, in 12-hour, am/pm format.
# %T Current time of day, in 24-hour format.
# %* Current time of day in 24-hour format, with seconds
# %N The name of the script, sourced file, or shell
# function that zsh is currently executing,
# %i The line number currently being executed in the script
# %w The date in day-dd format.
# %W The date in mm/dd/yy format.
# %D The date in yy-mm-dd format.
# %D{string} string is formatted using the strftime function (strftime(3))
# %l The line (tty) the user is logged in on
# %? The return code of the last command executed just before the prompt
# %_ The status of the parser
# %E Clears to end of line
# %# A `#' if the shell is running with privileges, a `%' if not
# %v The value of the first element of the psvar array parameter
# %{...%} Include a string as a literal escape sequence
# : literal ':'
# %Nc "relative path", ie last N components of $PWD.
# > literal '>'
#
# Some examples:
# PS1="PS1='%B%n%b@%m:%4c>'"
# PS1="%B(%b%n@%m%B)%b : %B(%b%3~%B)%b: "
# PS1=$'%{\e[1;31m%}[%n@%m:%~ ]%{\e[0m%} '
# PS1=$'%{\e[0;36m%}%n%{\e[0m%}:%{\e[0;31m%}%3~%{\e[0m%}%# ' ## user:~%
# PS1=$'%{\e[0;36m%}%n%{\e[0m%}:%{\e[0;31m%}%3~%{\e[0m%}%B>%b ' ## user:~>
# PS1='%n@%m:%4c%1v> ';RPS1=$'%{\e[0;36m%}%D{%A %T}%{\e[0m%}' ## user@host:~> ; Day time(hh:mm:ss)
# PS1='%B[%b%n%B:%b%~%B]%b$ ' ## [user:~]$
# PS1=$'%{\e[0;36m%}%n%{\e[0m%}:%20<..<%~%B>%b ' ## user:..c/vim-common-6.0>
# PS1=$'%{\e[0;36m%}%#%{\e[0m%} ';RPS1=$'%{\e[0;31m%}%~%{\e[0m%}' ## % ; ~
# PS1=$'%{\e[0;36m%}%n%{\e[0m%}%{\e[0;31m%}%#%{\e[0m%} ';RPS1=$'%{\e[0;31m%}%~%{\e[0m%}' ## user% ; ~
# PS1='%# ';RPS1='%B%~%b' ## % ; ~ : no colors
# PS1='%n@%m:%B%~%b> ' ## user@host:~> : no colors
# PS1=$'%{\e[1;31m%}%B(%b%{\e[0m%}%n@%m%{\e[1;31m%})%{\e[0m%} : %{\e[1;31m%}(%{\e[0m%}%~%{\e[1;31m%})%{\e[0m%}: '
# PS1=$'%{\e[0;33m%}[%{\e[0m%}%n%{\e[0;33m%}@%{\e[0m%}%m%{\e[0;33m%}:%{\e[0m%}%~%{\e[0;33m%}]%{\e[0m%}%# '
# PS1=$(echo '\033[1m\033[30m(%/)\033[0m\033[39m\n[%n@%m \033[0m\033[34m%~\033[0m\033[39m]%# ')
# PS1='%n@%U%m%u %B%30<..<%~%b %(!.#.>)' # user@host (underlined), pwd(bold; max 30 chars.) > or #
# PS1=$'%{\e[0;31m%}[%{\e[0;36m%}%n%{\e[0;32m%}@%{\e[0;35m%}%m%{\e[0;34m%}:%{\e[0;33m%}%.%{\e[0;31m%}]%{\e[0;0m%}%# '
# PROMPT=$'%n@%m %0(3c,%c,%~) %0(?,%{\e[0;32m%}=%),%{\e[0;31m%}=(%s)%b %# '
# random colors? sure. no problem ;)
# $ setopt prompt_subst ; PROMPT=$'[%{\e[$((color=$((30+$RANDOM % 8))))m%}%n@%m %c%{\e[00m%}]%% '
#
# You can use ``promptinit'' for the zsh prompt themes extension. See
# ``less ${^fpath}/promptinit(N)'' for details. btw. http://aperiodic.net/phil/prompt/
# is a good prompt introduction for the Z shell
if [[ $SSH_CLIENT = *.* || $REMOTEHOST = *.* ]]; then
RPROMPT=$SSH_CLIENT
setopt TRANSIENT_RPROMPT
fi
if (( EUID == 0 )); then
PS1=$'%{\e[0;33m%}%B[%b%{\e[0m%}%n%{\e[0;33m%}%B@%b%{\e[0m%}%m%{\e[0;33m%}:%{\e[0m%}%~%{\e[0;33m%}%B]%b%{\e[0m%}%# '
else
case $HOST in
dreckskind*)
PS1=$'%{\e[1;31m%}%B(%b%{\e[0m%}%n@%m%{\e[1;31m%})%{\e[0m%} : %{\e[1;31m%}(%{\e[0m%}%~%{\e[1;31m%})%{\e[0m%}: '
#PROMPT=$'\n%{\e[31m%}[%{\e[3;41;1;30m%}%n%{\e[0;31m%}@%{\e[3;41;1;30m%}%m%{\e[0;31m%}:%{\e[3;41;1;30m%}%~%{\e[0;31m%}] #%{\e[0m%} '
;;
painless*)
PROMPT=$'%{\e[0;31m%}%B[%b%{\e[0m%}%n%{\e[0;31m%}@%{\e[0m%}%m%{\e[0;31m%}%B:%b%{\e[0m%}%~ %0(?,%{\e[0;32m%}:%),%{\e[0;31m%}:(%s)%b%{\e[0;31m%}%B ]%b%{\e[0m%}%# '
#PROMPT=$'%{\e[0;31m%}%B[%b%{\e[0m%}%n%{\e[0;31m%}@%{\e[0m%}%m%{\e[0;31m%}%B:%b%{\e[0m%}%~%{\e[0;31m%}%B]%b%{\e[0m%}%# '
#PROMPT=$'%{\e[0;31m%}%B[%b%{\e[0m%}%n%{\e[0;31m%}@%{\e[0m%}%m%{\e[0;31m%}%B:%b%{\e[0m%}%~%{\e[0;31m%}%B]%b%{\e[0m%} %0(?,%{\e[0;32m%}:%),%{\e[0;31m%}:(%s)%b %# '
# On 'exit-Status != 0' display a ":(" on the right side.
#RPROMPT="%(?..:()%"
;;
fuckingtosh*)
autoload promptinit; promptinit ; prompt adam2
#PROMPT=$'\n%{\e[31m%}[%{\e[3;41;1;30m%}%n%{\e[0;31m%}@%{\e[3;41;1;30m%}%m%{\e[0;31m%}:%{\e[3;41;1;30m%}%~%{\e[0;31m%}] #%{\e[0m%} '
;;
blitzkrieg*)
PS1=$'%{\e[0;36m%}%n%{\e[0m%}%{\e[0;31m%}%#%{\e[0m%} '
RPS1=$'%{\e[0;31m%}%~%{\e[0m%}'
;;
diehard*)
PS1=$'%{\e[0;36m%}%n%{\e[0m%}:%{\e[0;31m%}%3~%{\e[0m%}%# '
;;
*)
PROMPT="[%n@%m] "
RPROMPT="[%~]"
esac
fi
# Show/Set the active command as title in Xterm/GNU Screen
# Needed for ssh-connections (i want ``user@hostname'' as title)
if [ -z "$SSH_CONNECTION" ]; then
# Change the title in xterm
function title()
{
# screen.linux, screen.unix, ..
if [[ $TERM == screen* ]]; then
print -nR $'\033k'$1$'\033'\\\
print -nR $'\033]0;'$2$'\a'
elif if [[ $TERM == "xterm" || $TERM == "rxvt" ]]; then
#precmd () { print -Pn "\e]0;[ %n@%m: %~ ] \a" }
print -nR $'\033]0;'$*$'\a'
fi
}
# the "default" title
function precmd() { title zsh "$IDENTITY:$(print -P %~)" }
function preexec()
{
emulate -L zsh
local -a cmd; cmd=(${(z)1})
# show ``vim ~/.zshrc'' instead of ``vim'' in the title.
if [[ $cmd[1] == "vim" || $cmd[1] == "man" || $cmd[1] == "cmus" ]] ; then
title "${cmd}"
else
title $cmd[1]:t "$cmd[2,-1]"
fi
}
fi
# Executed whenever a command has a non-zero exit status:
#--------------------------------------------------
if fortune bofh-excuses > /dev/null 2>&1 ;then
TRAPZERR() { fortune bofh-excuses | tail -n 1 }
else
TRAPZERR() { echo 'AAAAAAAARRRRGHHHHH!!'; }
fi
#--------------------------------------------------
# The prompt used for spelling correction. The sequence `%R' expands to
# the string which presumably needs spelling correction, and `%r' expands
# to the proposed correction. All other prompt escapes are also allowed.
SPROMPT=$'%BError!%b Correct %{\e[31m%}%R%{ \e[0m%}to%{ \e[36m%}%r%{ \e[0m%}? [No/Yes/Abort/Edit]: '