Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
executable file 597 lines (555 sloc) 24.6 KB
# (( ${+*} )) = 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.freenode.net" # **EDIT**
(( ${+EDITOR} )) || export EDITOR="vim" # **EDIT**
(( ${+VISUAL} )) || export VISUAL="vim" # **EDIT**
(( ${+OS} )) || export OS="${OSTYPE%%[0-9.]*}" # **FIXME**
(( ${+OSMAJOR} )) || export OSMAJOR="${OSVERSION%%.*}" # **FIXME**
(( ${+ORGANIZATION} )) || export ORGANIZATION="Guerrilla UNIX Development (Venimus, Vidimus, Dolavimus)" # **EDIT**
(( ${+GCC_COLORS} )) || export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01'
(( ${+SHITDIR} )) || export SHITDIR="$HOME/Trash"
(( ${+LESSCHARSET} )) || export LESSCHARSET=utf-8
(( ${+TERMINAL} )) || export TERMINAL=st
(( ${+TERM} )) || export TERM=xterm-256color
# Git <http://git.or.cz/>
if (( $+commands[git] )); then
(( ${+GIT_AUTHOR_EMAIL} )) || export GIT_AUTHOR_EMAIL="strcat1974@gmail.com"
(( ${+GIT_AUTHOR_NAME} )) || export GIT_AUTHOR_NAME="Christian Schneider"
(( ${+GIT_COMMITTER_EMAIL} )) || export GIT_COMMITTER_EMAIL=$GIT_AUTHOR_EMAIL
(( ${+GIT_PRETTY_FORMAT} )) || export GIT_PRETTY_FORMAT="--pretty=\"%C(bold green)%h%Creset%C(auto)%d%Creset %s\""
(( ${+GIT_PRETTY_FORMAT_AUTHOR} )) || export GIT_PRETTY_FORMAT_AUTHOR="--pretty=\"%C(bold green)%h%Creset %C(yellow)%an%Creset%C(auto)%d%Creset %s\""
fi
# Darcs <http://www.darcs.net/>
if (( $+commands[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 <http://tidy.sourceforge.net/>
if [[ -x `which tidy` ]]; then
(( ${+HTML_TIDY} )) || export HTML_TIDY=${HOME}/.tidyrc
fi
# FUCK YOU YOU FUCKING FUCK!
export PYTHONPATH=/bin/python
# Needed for Perl.. i think so!?
# 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
# Available or not?
(( $+commands[lesspipe.sh] )) && export LESSOPEN='|lesspipe.sh %s' # **EDIT**
# 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
# 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/$(uname -r)/packages/$(uname -m)"
;;
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 (( $+commands[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 LESSBINFMT='*u[%X]'
if [[ $terminfo[colors] -ge 8 ]] ; then
# blue manpages
# export LESS_TERMCAP_mb=$'\E[01;31m'
# export LESS_TERMCAP_md=$'\E[01;38;5;74m'
# export LESS_TERMCAP_me=$'\E[0m'
# export LESS_TERMCAP_se=$'\E[0m'
# export LESS_TERMCAP_so=$'\E[38;5;246m'
# export LESS_TERMCAP_ue=$'\E[0m'
# export LESS_TERMCAP_us=$'\E[04;38;5;146m'
export LESS_TERMCAP_mb=$'\E[1;31m' # begin bold
export LESS_TERMCAP_md=$'\E[1;36m' # begin blink
export LESS_TERMCAP_me=$'\E[0m' # reset bold/blink
export LESS_TERMCAP_so=$'\E[01;44;33m' # begin reverse video
export LESS_TERMCAP_se=$'\E[0m' # reset reverse video
export LESS_TERMCAP_us=$'\E[1;32m' # begin underline
export LESS_TERMCAP_ue=$'\E[0m' # reset underline
# red manpages
# 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
# gnarf
(( ${+READNULLCMD} )) || export READNULLCMD=${PAGER:-/usr/bin/pager}
# NOTE: This newsserver is *only* for T-Online user!
export NNTPSERVER='news.eternal-september.org'
# just for fun ..
export ZVERSION=${VERSION:-"zsh $ZSH_VERSION"}
# 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/"
# 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
# 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="0xF678E1DA"
export DEBUILD_DPKG_BUILDPACKAGE_OPTS="-i -ICVS -I.svn"
export DEBSIGN_SIGNLIKE=gpg
else
case ${OS} in
netbsd*)
export LANG="C"
;;
openbsd*)
export LANG=POSIX
;;
linux-gnu*)
export LANG=en_US.UTF-8
esac
fi
# https://github.com/trapd00r/LS_COLORS
# $ wget https://raw.github.com/trapd00r/LS_COLORS/master/LS_COLORS -O $HOME/.dircolors
# echo 'eval $(dircolors -b $HOME/.dircolors)' >> $HOME/.zshrc
# . $HOME/.zshrc
if [[ -e $HOME/.dircolors ]]; then
eval $(dircolors -b $HOME/.dircolors)
#--------------------------------------------------
# $ 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
#
#--------------------------------------------------
else
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
LS_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=0;33' # Sources = Bold, Yellow
LS_COLORS=$LS_COLORS:'*.C=0;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
fi
# 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="%B->%b %n has just %a %(l:tty%l:%U-Ghost-%u)%(m: from %m:)"
# 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"
# 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
# Number of history entries to save to disk
SAVEHIST=1000000
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 <TAB>)
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
192.168.1.{1..9}
192.168.178.{1..99}
)
zstyle ':completion:*:*:(zfanon|ftp):*' hosts $hosts
# Set the default system $PATH:
# /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 \
/opt/texlive/2017/bin/x86_64-linux/ \
/usr/games/bin \
/usr/bin/core_perl \
/home/dope/perl5/bin \
/home/dope/.gem/ruby/2.5.0/bin \
/home/dope/.gem/ruby/2.6.0/bin
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
# Perl
PERL5LIB="/home/dope/perl5/lib/perl5${PERL5LIB:+:${PERL5LIB}}"; export PERL5LIB;
PERL_LOCAL_LIB_ROOT="/home/dope/perl5${PERL_LOCAL_LIB_ROOT:+:${PERL_LOCAL_LIB_ROOT}}"; export PERL_LOCAL_LIB_ROOT;
PERL_MB_OPT="--install_base \"/home/dope/perl5\""; export PERL_MB_OPT;
PERL_MM_OPT="INSTALL_BASE=/home/dope/perl5"; export PERL_MM_OPT;
# 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 <http://sugi.nemui.org/doc/zsh/> 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
# 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/local/share/man \
/usr/share/man/old
do
[ -d "${mdir}" ] && MANPATH="${MANPATH}:${mdir}"
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
autoload -Uz vcs_info
precmd() {
psvar=()
vcs_info
[[ -n $vcs_info_msg_0_ ]] && psvar[1]="$vcs_info_msg_0_"
}
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
hellfire*)
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%}: '
;;
dreckskind*)
#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;32m%}%B[%b%{\e[0m%}%n%{\e[0;32m%}@%{\e[0m%}%m%{\e[0;32m%}%B:%b%{\e[0m%}%~%{\e[0;32m%}%B]%b%{\e[0m%} %(?..%{\e[0;33m%}%B!%b%{\e[0m%})%# '
# On 'exit-Status != 0' display a ":(" on the right side.
#RPROMPT="%(?..:()%"
RPROMPT="%F{green}%1v%f"
;;
fuckingtosh*)
autoload promptinit; promptinit ; prompt adam2
;;
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
# 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]: '
You can’t perform that action at this time.