Eure .zshrc

defcon

defcon

Kaiser
saiki schrieb:
eigentlich müsste man so einen thread mal über zsh machen

Hier mal meine .zshrc ;)

Code:
autoload -U compinit
compinit

# Prompt

PROMPT="%n@%m %c %# "

# Options for zsh
export HISTFILE=~/.zsh_history
export HISTSIZE=50000
export SAVEHIST=50000
export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games

zstyle ':completion:*' use-cache on
zstyle ':completion:*' cache-path ~/.zsh/cache

zstyle ':completion:*:kill:*' menu yes select
zstyle ':completion:*:kill:*' force-list always
#choice processes
zstyle ':completion:*:processes' command 'ps -A'

alias -g ...='../..'
alias -g ....='../../..'
alias -g .....='../../../..'

alias c="clear"
alias x="exit"
alias q="exit"
alias s="screen"
alias v="vim"
alias sv="sudo vim"
alias start_cpan='perl -MCPAN -e shell'

# ls colors
alias d="ls --color"
alias ls="ls --color=auto"
alias ll="ls --color -l"
alias la="ls --color -al"

# Debian Apt
alias sea="apt-cache search"
alias ins="sudo apt-get install"
alias rem="sudo apt-get remove"
alias upd="sudo apt-get update"

bindkey '^?' backward-delete-char
bindkey '^[[1~' beginning-of-line
#bindkey '^[[5~' up-line-or-history
bindkey '^[[3~' delete-char
bindkey '^[[4~' end-of-line
#bindkey '^[[6~' down-line-or-history
bindkey '^[[A' up-line-or-search
bindkey '^[[D' backward-char
bindkey '^[[B' down-line-or-search
bindkey '^[[C' forward-char
bindkey '^[[5~' history-search-backward
bindkey '^[[6~' history-search-forward

# archive entpacken
extract() {
   if [[ -z "$1" ]]; then
      print -P "usage: \e[1;36mextract\e[1;0m < filename >"
      print -P "       Extract the file specified based on the extension"
   elif [[ -f $1 ]]; then
      case ${(L)1} in
          *.tar.bz2)  tar -jxvf $1;;
          *.tar.gz)   tar -zxvf $1;;
          *.bz2)      bunzip2 $1   ;;
          *.gz)       gunzip $1   ;;
          *.jar)      unzip $1       ;;
          *.rar)      unrar x $1   ;;
          *.tar)      tar -xvf $1   ;;
          *.tbz2)     tar -jxvf $1;;
          *.tgz)      tar -zxvf $1;;
          *.zip)      unzip $1      ;;
          *.Z)        uncompress $1;;
         *)          echo "Unable to extract '$1' :: Unknown extension"
      esac
   else
      echo "File ('$1') does not exist!"
   fi
}

# archive packen
smartcompress() {
        if [ $2 ]; then
                case $2 in
                        tgz | tar.gz)   tar -zcvf$1.$2 $1 ;;
                        tbz2 | tar.bz2) tar -jcvf$1.$2 $1 ;;
                        tar.Z)          tar -Zcvf$1.$2 $1 ;;
                        tar)            tar -cvf$1.$2  $1 ;;
                        gz | gzip)      gzip           $1 ;;
                        bz2 | bzip2)    bzip2          $1 ;;
                        *)
                        echo "Error: $2 is not a valid compression type"
                        ;;
                esac
        else
                smartcompress $1 tar.gz
        fi
}

# debian upgrade
  upgrade () {
    if [ -z $1 ] ; then
        sudo apt-get update
        sudo apt-get -u upgrade
    else
        ssh $1 sudo apt-get update
# ask before the upgrade
        local dummy
        ssh $1 sudo apt-get --no-act upgrade
        echo -n "Process the upgrade ?"
        read -q dummy
        if [[ $dummy == "y" ]] ; then
            ssh $1 sudo apt-get -u upgrade --yes
        fi
    fi
}

# screenshot knipsen
  sshot() {
        [[ ! -d ~/shots  ]] && mkdir ~/shots
#cd ~/shots ; sleep 5 ; import -window root -depth 8 -quality 80 `date "+%Y-%m-%d--%H:%M:%S"`.png
        cd ~/shots ; sleep 5; import -window root shot_`date --iso-8601=m`.jpg
}
 
Zuletzt bearbeitet:
:think: Hmm... kann doch nicht sein, das hier niemand die zsh als Shell benutzt..
 
Hier ist mein abgespeckte ~/.zshrc.

Code:
# ~/.zshrc

## options
setopt \
	correct_all \
	interactive_comments \
	extended_glob glob glob_complete glob_dots \
	menu_complete \
	hash_cmds hash_dirs \
	hist_ignore_dups hist_ignore_space \
	vi

## remove duplicate entries from path, cdpath, manpath and fpath
typeset -U path cdpath manpath fpath

## use hard limits, except for a smaller stack and no core dumps
unlimit
limit stack 8192
limit core 0
limit -s

## Don't look at me
watch=(notme)

## default umask
umask 066

## Autoload some extensions
autoload -U compinit; compinit -C
autoload -U zfinit; zfinit
#autoload -U promptinit; promptinit; prompt suse

## Prompt
export PROMPT="; "

##
## String format
##

## The format of login  logout reports if the watch parameter is set.
WATCHFMT='Irrelevant person joined the collective => %B%n%b %a %l from %m at %B%t%b.'

## format of process time reports with 'time'
TIMEFMT="Real: %E User: %U System: %S Percent: %P Cmd: %J"

## SPROMPT (i.e., the spelling prompt)
SPROMPT='zsh: correct '%R' to '%r' ? ([Y]es/[N]o/[E]dit/[A]bort) '

##
## Path
##

## set path for the most linux distributions and {Net,Free,Open,DragonFly}BSD.
#path=(${HOME}/.bin /{,s}bin /usr/{,X11R6/,pkg/,local/,pkg/xorg/}{,s}bin /usr/games)
path=(/{,usr/{,local/,X11R6/,pkg/{,xorg/}}}{,s}bin /opt/{,gnome/,qt/,kde/}{,s}bin)

##
## I18N Setup
##

if [ $(uname) = FreeBSD ] ; then
	(( ${+LANG} )) || export LANG="en_GB"
	(( ${+LC_CTYPE} )) || export LC_CTYPE="en_GB.UTF-8"
	(( ${+LC_COLLATE} )) || export LC_COLLATE="C"
	(( ${+LC_TIME} )) || export LC_TIME="C"
	(( ${+LC_NUMERIC} )) || export LC_NUMERIC="C"
	(( ${+LC_MONETARY} )) || export LC_MONETARY="C"
	(( ${+LC_MESSAGES} )) || export LC_MESSAGES="en_GB.UTF-8"
	(( ${+LC_ALL} )) || export LC_ALL=""
elif [ $(uname) = Linux ] ; then
	(( ${+LANG} )) || export LANG="en_GB.utf8"
	(( ${+LC_CTYPE} )) || export LC_CTYPE="en_GB.utf8"
	(( ${+LC_NUMERIC} )) || export LC_NUMERIC="en_GB.utf8"
	(( ${+LC_TIME} )) || export LC_TIME="en_GB.utf8"
	(( ${+LC_COLLATE} )) || export LC_COLLATE="C"
	(( ${+LC_MONETARY} )) || export LC_MONETARY="en_GB.utf8"
	(( ${+LC_MESSAGES} )) || export LC_MESSAGES="en_GB.utf8"
	(( ${+LC_PAPER} )) || export LC_PAPER="en_GB.utf8"
	(( ${+LC_NAME} )) || export LC_NAME="en_GB.utf8"
	(( ${+LC_ADDRESS} )) || export LC_ADDRESS="en_GB.utf8"
	(( ${+LC_TELEPHONE} )) || export LC_TELEPHONE="en_GB.utf8"
	(( ${+LC_MEASUREMENT} )) || export LC_MEASUREMENT="en_GB.utf8"
	(( ${+LC_IDENTIFICATION} )) || export LC_IDENTIFICATION="en_GB.utf8"
	(( ${+LC_ALL} )) || export LC_ALL=""
fi

(( ${+GTK_IM_MODULE} )) || export GTK_IM_MODULE=scim

(( ${+CVS_RSH} )) || export CVS_RSH=$(which ssh)
(( ${+SVN_RSH} )) || export SVN_RSH=$(which ssh)
(( ${+RSYNC_RSH} )) || export RSYNC_RSH=$(which ssh)

(( ${+EDITOR} )) || export EDITOR=$(which vim)
(( ${+PAGER} )) || export PAGER=$(which less)
(( ${+BROWSER} )) || export BROWSER=$(which epiphany)
(( ${+WINDOW_MANAGER} )) || export WINDOW_MANAGER=$(which metacity)

if [ $(uname) = FreeBSD ] ; then
	(( ${+LSCOLORS} )) || export LSCOLORS="exgxfxdxcxhxhxbxbxexex"
fi

##
## Aliases
##

alias x="xinit 2>&1 -- -nolisten tcp :0 | tee ~/.Xserver.log"
alias j="jobs"
alias jag="w | grep $(id -un)"
alias du="du -sh"

if which gls>/dev/null; then
	alias ls="gls --color=yes"
else
	if [ $(uname) != Linux ] ; then
		alias ls="ls -G"
	else
		alias ls="ls --color=yes"
	fi
fi

alias ll="ls -lh"                      # human read. list
alias la="ls -A"                       # show all files
alias lla="ls -lhA"                    # show all files as list
alias lsd="ls -lhd *(/)"               # show only directories
alias lad="ls -lhd .*(/)"              # show only dot.dir
alias lsa="ls -A .*(.)"                # show only dot.files
alias lsbig="ls -lSh *(.) | head"      # show the biggest files
alias lssmall="ls -Sl *(.) | tail"     # show the smallest files
alias lsnew="ls -rtl *(.) | tail"      # show the newest files
alias lsold="ls -rtl *(.) | head"      # show the oldest files
alias sl="ls"                          # *Narf*

##
## Keys
##

case $TERM in
	*xterm*|rxvt|screen)
	bindkey "^[[1;5C" forward-word                          # C-right
	bindkey "^[[1;5D" backward-word                         # C-left
	bindkey "^[[5~" beginning-of-history                    # PgUp
	bindkey "^[[6~" end-of-history                          # PgDn
	bindkey "^[OH" beginning-of-line                        # Home
	bindkey "^[OF" end-of-line                              # End
	bindkey "^[[3~" delete-char                             # Delete
	bindkey "^[[2~" overwrite-mode                          # Insert
	bindkey "^[[A" history-beginning-search-backward        # tcsh-like history search backword up
	bindkey "^[[B" history-beginning-search-forward         # tcsh-like history search forward down
	;;
	vt*|cons*|linux)
	bindkey "^[[C" forward-word                             # C-right
	bindkey "^[[D" backward-word                            # C-left
	bindkey "^[[5~" beginning-of-history                    # PgUp
	bindkey "^[[6~" end-of-history                          # PgDn
	bindkey "^[[7~" beginning-of-line                       # Home
	bindkey "^[[8~" end-of-line                             # End
	bindkey "^[[3~" delete-char                             # Delete
	bindkey "^[[2~" overwrite-mode                          # Insert
	bindkey "^[[A" history-beginning-search-backward        # tcsh-like history search backword up
	bindkey "^[[B" history-beginning-search-forward         # tcsh-like history search forward down
	;;
esac

##
## zStyle
##

## add colors to completions - looks nicer :)
zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS}

## With commands like `rm' it's annoying if one gets offered the same filename
## again even if it is already on the command line. To avoid that: 
zstyle ':completion:*:rm:*' ignore-line yes 

## Separate matches into groups
zstyle ':completion:*:matches' group 'yes'

## Completion options colorized
zstyle ':completion:*:(options|values)' list-colors '=(#b)(*)-- (*)=35;1=31;1=33;1' '=*=31;1'

## completion for some programs
zstyle ':completion:*:*:mpg123:*' file-patterns '*.(mp3|MP3):mp3\ files *(-/):directories'
zstyle ':completion:*:*:ogg123:*' file-patterns '*.(ogg|OGG):ogg\ files *(-/):directories'
zstyle ':completion:*:*:mplayer:*' file-patterns '*.(m4a|M4A):m4a\ files *(-/):directories'

##
## Functions
##

suidfind() {
	ls -l /**/*(su0x)
}

sshot()  {
	if [ $# = 0 ] ; then
		echo "     Usage        : $0 pattern"
		echo "     Example      : $0 fnord 85"
	else
		sleep 5; import -window root -quality $2 Screenshot-$1-`date +%y%m%d`.jpg;
	fi
}
 
-schnell, modular, flexibel
-hat von haus aus viele features
-läuft auf allen unices
-erweitertes pipe system
-spelling correction
-....

das könnt ewig so weitergehen *g*
Aber hier gehts ja nicht darum "Warum" man die zsh mag, sondern um die .zshrc derjenigen, die die zsh benutzen.

//Edit:
Code:
autoload -U zfinit; zfinit
was macht den zfinit? kenn ich gar nicht
 
Zuletzt bearbeitet:
Nicht schlecht mit dem zfopen usw., grad mal ausprobiert.
Leider wird aber nicht angezeigt das die Verbindung besteht, und auch nicht in welchem pfad man grade ist.
Erst zfhere usw. eintippseln is dann doch etwas umständlich.
 
Also, ich probier grad auch mal die zsh aus. Aber auch nur, weil im IRC da jemand sooo von geschwärmt hat. Bis jetzt kann ich keine nennenswerten Vor-Nachteile ausmachen. Ih habe aber eine .zshrc im Netzt gefunden mit dem coolem prompt:
Code:
# Version und Kernel
echo "Debian GNU/Linux 4.0 - Kernel $(uname -r)"
echo -------------------------------------------

# Editor
export EDITOR=/usr/bin/joe

# Lines configured by zsh-newuser-install
HISTFILE=~/.histfile
#HISTSIZE=1000
#SAVEHIST=1000
#setopt autocd nomatch notify
# End of lines configured by zsh-newuser-install
# The following lines were added by compinstall
zstyle :compinstall filename '/home/buli/.zshrc'

#autoload -Uz compinit
#compinit
# End of lines added by compinstall

############################################################


function precmd {

local TERMWIDTH
(( TERMWIDTH = ${COLUMNS} - 1 ))


###
# Truncate the path if it's too long.

PR_FILLBAR=""
PR_PWDLEN=""

local promptsize=${#${(%):---(%n@%m:%l)---()--}}
local pwdsize=${#${(%):-%~}}

if [[ "$promptsize + $pwdsize" -gt $TERMWIDTH ]]; then
((PR_PWDLEN=$TERMWIDTH - $promptsize))
else
PR_FILLBAR="\${(l.(($TERMWIDTH - ($promptsize + $pwdsize)))..${PR_HBAR}.)}"
fi


###
# Get APM info.

if which ibam > /dev/null; then
PR_APM_RESULT=`ibam --percentbattery`
elif which apm > /dev/null; then
PR_APM_RESULT=`apm`
fi
}


setopt extended_glob
preexec () {
if [[ "$TERM" == "screen" ]]; then
local CMD=${1[(wr)^(*=*|sudo|-*)]}
echo -n "\ek$CMD\e\\"
fi
}


setprompt () {
###
# Need this so the prompt will work.

setopt prompt_subst


###
# See if we can use colors.

autoload colors zsh/terminfo
if [[ "$terminfo[colors]" -ge 8 ]]; then
colors
fi
for color in RED GREEN YELLOW BLUE MAGENTA CYAN WHITE; do
eval PR_$color='%{$terminfo[bold]$fg[${(L)color}]%}'
eval PR_LIGHT_$color='%{$fg[${(L)color}]%}'
(( count = $count + 1 ))
done
PR_NO_COLOUR="%{$terminfo[sgr0]%}"


###
# See if we can use extended characters to look nicer.

typeset -A altchar
set -A altchar ${(s..)terminfo[acsc]}
PR_SET_CHARSET="%{$terminfo[enacs]%}"
PR_SHIFT_IN="%{$terminfo[smacs]%}"
PR_SHIFT_OUT="%{$terminfo[rmacs]%}"
PR_HBAR=${altchar[q]:--}
PR_ULCORNER=${altchar[l]:--}
PR_LLCORNER=${altchar[m]:--}
PR_LRCORNER=${altchar[j]:--}
PR_URCORNER=${altchar[k]:--}


###
# Decide if we need to set titlebar text.

case $TERM in
xterm*)
PR_TITLEBAR=$'%{\e]0;%(!.-=*[ROOT]*=- | .)%n@%m:%~ | ${COLUMNS}x${LINES} | %y\a%}'
;;
screen)
PR_TITLEBAR=$'%{\e_screen \005 (\005t) | %(!.-=[ROOT]=- | .)%n@%m:%~ | ${COLUMNS}x${LINES} | %y\e\\%}'
;;
*)
PR_TITLEBAR=''
;;
esac


###
# Decide whether to set a screen title
if [[ "$TERM" == "screen" ]]; then
PR_STITLE=$'%{\ekzsh\e\\%}'
else
PR_STITLE=''
fi


###
# APM detection

if which ibam > /dev/null; then
PR_APM='$PR_RED${${PR_APM_RESULT[(f)1]}[(w)-2]}%%(${${PR_APM_RESULT[(f)3]}[(w)-1]})$PR_LIGHT_BLUE:'elif which apm > /dev/null; then
PR_APM='$PR_RED${PR_APM_RESULT[(w)5,(w)6]/\% /%%}$PR_LIGHT_BLUE:'
else
PR_APM=''
fi


###
# Finally, the prompt.

PROMPT='$PR_SET_CHARSET$PR_STITLE${(e)PR_TITLEBAR}\
$PR_GREEN$PR_SHIFT_IN$PR_ULCORNER$PR_GREEN$PR_HBAR$PR_SHIFT_OUT(\
$PR_WHITE%(!.%SROOT%s.%n)$PR_GREEN@$PR_WHITE%m\
$PR_GREEN)$PR_SHIFT_IN$PR_HBAR$PR_GREEN$PR_HBAR${(e)PR_FILLBAR}$PR_GREEN$PR_HBAR$PR_SHIFT_OUT(\
$PR_WHITE%$PR_PWDLEN<...<%~%<<\
$PR_GREEN)$PR_SHIFT_IN$PR_HBAR$PR_GREEN$PR_URCORNER$PR_SHIFT_OUT\

$PR_GREEN$PR_SHIFT_IN$PR_LLCORNER$PR_GREEN$PR_HBAR$PR_SHIFT_OUT(\
%(?..$PR_GREEN%?$PR_GREEN:)\
${(e)PR_APM}$PR_WHITE%D{%H:%M}\
$PR_GREEN:%(!.$PR_GREEN.$PR_WHITE)%#$PR_GREEN)$PR_SHIFT_IN$PR_HBAR$PR_SHIFT_OUT\
$PR_GREEN$PR_SHIFT_IN$PR_HBAR$PR_SHIFT_OUT\
$PR_NO_COLOUR '

RPROMPT=' $PR_GREEN$PR_SHIFT_IN$PR_HBAR$PR_GREEN$PR_HBAR$PR_SHIFT_OUT\
($PR_WHITE%D{%a,%b%d}$PR_GREEN)$PR_SHIFT_IN$PR_HBAR$PR_GREEN$PR_LRCORNER$PR_SHIFT_OUT$PR_NO_COLOUR'
PS2='$PR_GREEN$PR_SHIFT_IN$PR_HBAR$PR_SHIFT_OUT\
$PR_GREEN$PR_SHIFT_IN$PR_HBAR$PR_SHIFT_OUT(\
$PR_GREEN%_$PR_GREEN)$PR_SHIFT_IN$PR_HBAR$PR_SHIFT_OUT\
$PR_GREEN$PR_SHIFT_IN$PR_HBAR$PR_SHIFT_OUT$PR_NO_COLOUR '
}

setprompt

#############################################################

function precmd {

local TERMWIDTH
(( TERMWIDTH = ${COLUMNS} - 1 ))

###
# See if we can use colors.

# Must have the zsh/termcap module loaded for this
if [[ $terminfo[colors] -ge 8 ]]; then
local RED="%{1m%}"
local LIGHT_RED="%{;31m%}"
local CYAN="%{6m%}"
local LIGHT_CYAN="%{;36m%}"
local BLUE="%{4m%}"
local LIGHT_BLUE="%{;34m%}"
local GREEN="%{2m%}"
local LIGHT_GREEN="%{;32m%}"
local MAGENTA="%{5m%}"
local LIGHT_MAGENTA="%{;35m%}"
local YELLOW="%{3m%}"
local LIGHT_YELLOW="%{;33m%}"
local GRAY="%{0m%}"
local LIGHT_GRAY="%{;37m%}"
local WHITE="%{7m%}"
local NO_COLOUR="%{m%}"
local BEGINNING_OF_LINE="%{D%}"
else
local RED=""
local LIGHT_RED=""
local CYAN=""
local LIGHT_CYAN=""
local BLUE=""
local LIGHT_BLUE=""
local GREEN=""
local LIGHT_GREEN=""
local MAGENTA=""
local LIGHT_MAGENTA=""
local YELLOW=""
local LIGHT_YELLOW=""
local GRAY=""
local LIGHT_GRAY=""
local WHITE=""
local NO_COLOUR=""
local BEGINNING_OF_LINE=""
fi

###
# Decide whether to set a screen title
if [[ "$STY" != "" ]]; then
local STITLE='%{zsh%}'
else
local STITLE=''
fi

###
# Decide if we need to set titlebar text.
case $TERM in
xterm*)
local TITLEBAR='%{;%n@%m:%~%}'
;;
screen)
local TITLEBAR='%{;screen  (t) %n@%m:%~%}'
;;
*)
local TITLEBAR=""
;;
esac

###
# See if we can use extended characters to look nicer.

case $TERM in
linux|xterm*)
local SHIFT_IN='%{%}'
local SHIFT_OUT='%%}'
local HBAR='q'
local ULCORNER='l'
local LLCORNER='m'
local LRCORNER='j'
local URCORNER='k'
;;
*)
local SHIFT_IN=""
local SHIFT_OUT=""
local HBAR='-'
local ULCORNER='-'
local LLCORNER='-'
local LRCORNER='-'
local URCORNER='-'
;;
esac

###
# Truncate the path if it's to long.
local fill=""
local pwdlen=""

let local promptsize=$(print -Pn -- "--(%n@%m:%l)---()--" | wc -c | tr -d " ")
let local pwdsize=$(print -Pn -- "%~" | wc -c | tr -d " ")

if [[ "$promptsize + $pwdsize" -gt $TERMWIDTH ]]; then
let pwdlen="$TERMWIDTH - $promptsize"
else
let fillsize="$TERMWIDTH - ($promptsize + $pwdsize)"
while [[ $fillsize -gt 0 ]]
do
fill="${fill}$HBAR"
let fillsize=${fillsize}-1
done
fi


}

preexec () {
if [[ "$STY" != "" ]]; then
local CMD=`echo $1 | sed 's/^sudo //; s/ .*//'`
echo -n "$CMD"
fi
}

###--------------------------------------------------
### parameters

fignore=(\~ .o .log .aux .elc .reg .pro .in .md{d,h,hi,hs} .epro .syms)

if [[ -f /usr/local/share/zsh/std-funcs.zwc ]]; then
fpath=(/usr/local/share/zsh/std-funcs.zwc $fpath ~/.zshfuncs)
else
fpath=($fpath ~/.zshfuncs)
fi

path=(~/bin $path)
hosts=(bar.com cvs.sf.net)

DIRSTACKSIZE=30
HISTSIZE=5000
SAVEHIST=5000
setopt SHARE_HISTORY
READNULLCMD=less

export LESSCHARSET=iso8859

###--------------------------------------------------
### aliases

alias -g 'G'='|grep -i --color=auto'
alias 'jetzt'='lynx -nolist -dump http://text.hoerzu.de/tv-programm/jetzt.php'
alias 'm'='less'
#alias 'l'='ls -avF --color=auto'
alias 'ls'='ls -lv --color=auto'
alias 'mk'='make'
alias 'which-command'='whence -afv'
alias 'which'='whence -afv'
alias 'pushd'='pushd;dirs -v'
alias 'popd'='podp;dirs -v'
alias 'd'='dirs -v'
alias 'j'='jobs -lp'
alias 'h'='fc -ldD -40'
# ls-aliases
alias la='ls -la'
alias lg='ls -lh | less'
# verbose
 alias cp='cp -v'
 alias mv='mv -v'
 alias rm='rm -v'
# nice aliases
 alias ifc='sudo ifconfig'
 alias pi='ping www.alice-dsl.de'
 alias ipt='sudo iptables -L'
 alias scan='sudo nmap localhost'
 alias net='sudo netstat -ap'
 alias ps='sudo ps aux'

###--------------------------------------------------
### functions

ll() {
ls -la --color=auto "$@" | more
}

.() {
if [[ $# -eq 0 ]]; then
cd $OLDPWD
else
builtin . $*
fi
}

###--------------------------------------------------
### options

setopt autocd autolist automenu autopushd braceccl cdablevars
setopt correct extendedglob noflowcontrol
setopt histignoredups histignorespace histnostore listtypes longlistjobs
setopt cshnullglob magicequalsubst listpacked
setopt numericglobsort pushdignoredups pushdminus pushdsilent
setopt pushdtohome rcexpandparam rcquotes
setopt sunkeyboardhack zle nobadpattern autoremoveslash
setopt completeinword autoparamkeys
setopt alwayslastprompt

unsetopt bgnice norcs notify nonomatch hashdirs listambiguous


###--------------------------------------------------
### completion

zmodload zsh/complist
zmodload zsh/computil

autoload compinit
compinit

zstyle ':completion:*:*:cd:*' tag-order local-directories
zstyle ':completion:*:*:lp*:*' tag-order jobs
zstyle ':completion:*:*:(kill|wait):*' tag-order 'jobs processes'
zstyle ':completion:*:*:(kill|wait):*' group-order jobs
zstyle ':completion:*:*' users-hosts \
foo@bar.com \
baz@foobar.net
zstyle ':completion:*' use-compctl false
zstyle ':completion:*:match:*' original yes
zstyle ':completion:incremental:*' list yes
zstyle ':completion:incremental:*' prompt 'incremental (%c): %u%s%a %l'
zstyle ':completion:*:oldlist:*' menu verbose
zstyle ':completion:predict:*' completer _complete
zstyle ':completion:predict:*' list always
zstyle ':completion:predict:*' cursor key
zstyle ':completion:predict:*' special-dirs yes
zstyle ':completion:*:default' menu select
zstyle ':completion:*:(correct|approximate):*' max-errors 2 numeric
zstyle ':completion:*:(correct|approximate)-*:*' original yes
zstyle ':completion:*:paths' expand prefix
zstyle ':completion:*:option(-*|s)' auto-description 'specify %d'
zstyle ':completion:*:processes' command ps --forest -u $EUID -o pid,cmd
zstyle ':completion:*' verbose yes
zstyle ':completion:*' prefix-needed yes
zstyle ':completion:*' prefix-hidden no
zstyle ':completion:*' last-prompt yes
zstyle ':completion:*' users foo baz root
zstyle ':completion:*:complete:*:(all-|)files' ignored-patterns \
'?*~' '?*.(o|log|aux|elc|reg|pro|md[dh]|mdh[is]|syms|epro)' '(|*/)CVS'
zstyle ':completion:*:complete:*:(local|path)-directories' ignored-patterns '(|*/)CVS'
zstyle ':completion:*' group-name ''
zstyle ':completion:*:jobs' prefix-needed no
zstyle ':completion:*' ignore-parents pwd parent
zstyle ':completion:*:complete:*:(functions|parameters|association-keys)' ignored-patterns '_*'
zstyle ':completion:::::' completer _complete _match _ignored _correct _approximate _prefix
zstyle ':completion:*' matcher-list '' 'm:{a-z-}={A-Z_} r:|[-_./]=* r:|=*' 'm:{a-z-}={A-Z_} l:|=* r:|=*'
zstyle ':completion:*:*:diff:*:version' command =diff -v
zstyle ':completion:*:*:(p|gview|xdvi|kill|psnup):*' menu yes select
zstyle ':completion:*:*:(p|gview|xdvi|psnup):*' file-sort time
zstyle ':completion:*:default' list-prompt '%{;37m%} Line %l Continue? %b'
zstyle ':completion:*:default' select-prompt '%{;37m%} Match %m Line %l %p %b'
zstyle ':completion:*:(cp|mv|rm):*' ignore-line yes
zstyle ':completion:*:kill:*' force-list always
zstyle ':completion:*:*:*make:*:targets' command awk \''/^[a-zA-Z0-9][^\/\t=]+:/ {print $1}'\' \$file
zstyle ':completion:*history*' remove-all-dups yes
zstyle ':completion:*history*' stop yes

zstyle ':completion:*:(correct|approximate)-*:*:corrections' format '%{1m%}-------------------- %{;41m%} correct %{m%} %{;41m%} %e %{m%} %{;43m%} %-35.35o %{m%}'
zstyle ':completion:*:expand:*:expansions' format '%{1m%}--------------------------- %{;41m%} expand %{m%} %{;43m%} %-35.35o %{m%}'
zstyle ':completion:*:default' list-colors 'tc=35' 'ma=41;37' 'st=43;36' 'di=31;1' 'ex=33;1' \
'ln=32' '*CVS=35' '*rej=31;1' '*orig=35'
zstyle ':completion:*:descriptions' format '%{4m%}-------------------------------------- %{;37m%} %-35.35d %{m%}'
zstyle ':completion:*:messages' format '%{4m%}-------------------------------------- %{;37m%} %-35.35d %{m%}'
zstyle ':completion:*:warnings' format '%{1m%}-------------------------------------- %{;41m%} no match for %{m%}
%{m%}%D%{m%}'
zstyle ':completion:*:processes' list-colors \
'=(#b)( #[0-9]#)[^[/0-9a-zA-Z]#(*)=34=37;1=30;1'
zstyle ':completion:*:parameters' list-colors '=_*=33' '=[^a-zA-Z]*=31'
zstyle ':completion:*:functions' list-colors '=_*=33' '=*-*=31'
zstyle ':completion:*:original' list-colors '=*=31;1'
zstyle ':completion:*:all-expansions' list-colors '=*=32'
zstyle ':completion:*:reserved-words' list-colors '=*=31'
zstyle ':completion:*:(jobs|directory-stack|indexes)' list-colors \
'=(#b)(*) -- (*)=35;1=31;1=33;1'
zstyle ':completion:*:(options|values)' list-colors \
'=(#b)(*)-- (*)=35;1=31;1=33;1' '=*=31;1'
zstyle ':completion:*::lp*:jobs' list-colors '=(#b)* [0-9] ##([^ ]##) ##([^ ]##) ##([^ ]##) ##(*)=35=32=31;1=33;1=32'


SELECTMIN=5
ZLS_COLOURS='ma=7:di=0:ex=0:bd=0:cd=0:ln=0:so=0'

bindkey -M menuselect '/' accept-and-infer-next-history \
'^U' undo \
'^@' accept-and-menu-complete \
'^A' .beginning-of-line-hist \
'^E' .end-of-line-hist \
'^P' vi-forward-blank-word \
'^N' vi-backward-blank-word \
'\e<' beginning-of-history \
'\e>' end-of-history
Sieht dann so aus:
http://xs314.xs.to/xs314/07173/zsh_prompt.png.xs.jpg

Was da ausserhalb der Promptdefinierung so alles vor sich geht, kann ich nicht genau sagen ;)
 
Der Prompt is ja echt genial.

Sowas will ich für meine BASH auch :D
 
Ja, ich auch. Aber ich blick bei den ganzen Funktionen von der .zshrc nicht so ganz durch.
Deswegen kann ich ihn schlecht übetragen.:(
es ist auch gar nicht Möglich mit Bash Standard mitteln.

Gruß

zyon // Auch ein Zsh Lover!
 
Ja, der Prompt ist nett :D

Auch eine schöne .zshrc ist die in grml.org integrierte. Selber hab ich leider keine, mir hat immer die standart-Bash bisher gereicht, bzw. die Motivation für die Einarbeitung in die zsh war noch nicht so gross ;)
 
Code:
# Lines configured by zsh-newuser-install
HISTFILE=~/.histfile
HISTSIZE=1000
SAVEHIST=1000
setopt autocd
bindkey -e
# End of lines configured by zsh-newuser-install
# The following lines were added by compinstall
zstyle :compinstall filename '/home/buli/.zshrc'

autoload -Uz compinit
compinit
# End of lines added by compinstall

##
# Datum
datum=$(date +"%d-%m-%Y")

##
# Editor
EDITOR=joe
##
# Prompt
function precmd {

    local TERMWIDTH
    (( TERMWIDTH = ${COLUMNS} - 1 ))


    ###
    # Truncate the path if it's too long.

    PR_FILLBAR=""
    PR_PWDLEN=""

    local promptsize=${#${(%):---(%n@%m:%l)---()--}}
    local pwdsize=${#${(%):-%~}}

    if [[ "$promptsize + $pwdsize" -gt $TERMWIDTH ]]; then
            ((PR_PWDLEN=$TERMWIDTH - $promptsize))
    else
        PR_FILLBAR="\${(l.(($TERMWIDTH - ($promptsize + $pwdsize)))..${PR_HBAR}.)}"
    fi


    ###
    # Get APM info.

    if which ibam > /dev/null; then
        PR_APM_RESULT=`ibam --percentbattery`
    elif which apm > /dev/null; then
        PR_APM_RESULT=`apm`
    fi
}


setopt extended_glob
preexec () {
    if [[ "$TERM" == "screen" ]]; then
        local CMD=${1[(wr)^(*=*|sudo|-*)]}
        echo -n "\ek$CMD\e\\"
    fi
}


setprompt () {
    ###
    # Need this so the prompt will work.

    setopt prompt_subst


    ###
    # See if we can use colors.

    autoload colors zsh/terminfo
    if [[ "$terminfo[colors]" -ge 8 ]]; then
        colors
    fi
    for color in RED GREEN YELLOW BLUE MAGENTA CYAN WHITE; do
        eval PR_$color='%{$terminfo[bold]$fg[${(L)color}]%}'
        eval PR_LIGHT_$color='%{$fg[${(L)color}]%}'
        (( count = $count + 1 ))
    done
    PR_NO_COLOUR="%{$terminfo[sgr0]%}"


    ###
    # See if we can use extended characters to look nicer.

    typeset -A altchar
    set -A altchar ${(s..)terminfo[acsc]}
    PR_SET_CHARSET="%{$terminfo[enacs]%}"
    PR_SHIFT_IN="%{$terminfo[smacs]%}"
    PR_SHIFT_OUT="%{$terminfo[rmacs]%}"
    PR_HBAR=${altchar[q]:--}
    PR_ULCORNER=${altchar[l]:--}
    PR_LLCORNER=${altchar[m]:--}
    PR_LRCORNER=${altchar[j]:--}
    PR_URCORNER=${altchar[k]:--}


    ###
    # Decide if we need to set titlebar text.

    case $TERM in
        xterm*)
            PR_TITLEBAR=$'%{\e]0;%(!.-=*[ROOT]*=- | .)%n@%m:%~ | ${COLUMNS}x${LINES} | %y\a%}'
            ;;
        screen)
            PR_TITLEBAR=$'%{\e_screen \005 (\005t) | %(!.-=[ROOT]=- | .)%n@%m:%~ | ${COLUMNS}x${LINES} | %y\e\\%}'
            ;;
        *)
            PR_TITLEBAR=''
            ;;
    esac


    ###
    # Decide whether to set a screen title
    if [[ "$TERM" == "screen" ]]; then
        PR_STITLE=$'%{\ekzsh\e\\%}'
    else
        PR_STITLE=''
    fi


    ###
    # APM detection

    if which ibam > /dev/null; then
        PR_APM='$PR_RED${${PR_APM_RESULT[(f)1]}[(w)-2]}%%(${${PR_APM_RESULT[(f)3]}[(w)-1]})$PR_LIGHT_BLUE:'
    elif which apm > /dev/null; then
        PR_APM='$PR_RED${PR_APM_RESULT[(w)5,(w)6]/\% /%%}$PR_LIGHT_BLUE:'
    else
        PR_APM=''
    fi


    ###
    # Finally, the prompt.

    PROMPT='$PR_SET_CHARSET$PR_STITLE${(e)PR_TITLEBAR}\
$PR_CYAN$PR_SHIFT_IN$PR_ULCORNER$PR_BLUE$PR_HBAR$PR_SHIFT_OUT(\
$PR_RED%(!.%SROOT%s.%n)$PR_RED@%m:%l\
$PR_BLUE)$PR_SHIFT_IN$PR_HBAR$PR_CYAN$PR_HBAR${(e)PR_FILLBAR}$PR_BLUE$PR_HBAR$PR_SHIFT_OUT(\
$PR_MAGENTA%$PR_PWDLEN<...<%~%<<\
$PR_BLUE)$PR_SHIFT_IN$PR_HBAR$PR_CYAN$PR_URCORNER$PR_SHIFT_OUT\

$PR_CYAN$PR_SHIFT_IN$PR_LLCORNER$PR_BLUE$PR_HBAR$PR_SHIFT_OUT(\
%(?..$PR_LIGHT_RED%?$PR_BLUE:)\
${(e)PR_APM}$PR_YELLOW%D{%H:%M}\
$PR_LIGHT_BLUE:%(!.$PR_RED.$PR_WHITE)%#$PR_BLUE)$PR_SHIFT_IN$PR_HBAR$PR_SHIFT_OUT\
$PR_CYAN$PR_SHIFT_IN$PR_HBAR$PR_SHIFT_OUT\
$PR_NO_COLOUR '

    RPROMPT=' $PR_CYAN$PR_SHIFT_IN$PR_HBAR$PR_BLUE$PR_HBAR$PR_SHIFT_OUT\
($PR_YELLOW%D{%a,%b%d}$PR_BLUE)$PR_SHIFT_IN$PR_HBAR$PR_CYAN$PR_LRCORNER$PR_SHIFT_OUT$PR_NO_COLOUR'
    PS2='$PR_CYAN$PR_SHIFT_IN$PR_HBAR$PR_SHIFT_OUT\
$PR_BLUE$PR_SHIFT_IN$PR_HBAR$PR_SHIFT_OUT(\
$PR_LIGHT_GREEN%_$PR_BLUE)$PR_SHIFT_IN$PR_HBAR$PR_SHIFT_OUT\
$PR_CYAN$PR_SHIFT_IN$PR_HBAR$PR_SHIFT_OUT$PR_NO_COLOUR '
}

setprompt

##
# Pfad
export PATH=$PATH:/home/buli/scripting/sh:/home/buli/scripting/perl:/home/buli/scripting/C-C++

##
# aliases
#
# ls
alias l='ls -h --color=auto'
alias ll='ls -lh --color=auto'
alias la='ls -lah --color=auto'
alias lg='ls -lh | less'

# alias to avoid making mistakes:
 alias rm='rm -iv'
 alias cp='cp -iv'
 alias mv='mv -iv'

# Nice aliases
 alias ps='ps aux | grep ${1}'
 alias ipt='iptables -L'
 alias net='netstat -apt'
 alias ifc='ifconfig'

# cd und list
cdd () { cd ${1} ; echo $PWD ; ls -lh --color ; }
alias cd='cdd'

# apt-gedöns
 alias inst='apt-get install'
 alias uinst='apt-get --purge remove'
 search () { apt-cache search ${1}|less; }
 alias srch='search'
 alias reinst='apt-get install ${1} --reinstall'
 alias upd='apt-get update'
 alias upgrd='apt-get upgrade'
 alias show='apt-cache show'
 
Code:
autoload -U compinit
compinit

# Farbdefinition
CYAN_F="\033[00;36m"
NORM_F="\033[00m"
BG_BLUE="%{"$'\033[00;44m'"%}"
NORM="%{"$'\033[00m'"%}"

# Minimal prompt
export PS1="${BG_BLUE}(%~)${NORM} "

# Dircolors
eval `dircolors ~/.dircolors`

# Optionen fuer Completion
zstyle ':completion::complete:*' use-cache 1
zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS}
zstyle ':completion:*' menu select

# man Completion
zstyle ':completion:*:*:man:*' menu yes

# Completion fuer nvup
_nvup() { compadd eth0 eth2 ; }
compdef _nvup nvup

# known_hosts mit in die hosts completion uebernehmen
local _myhosts
_myhosts=( ${${${${(f)"$(<$HOME/.ssh/known_hosts)"}:#[0-9]*}%%\ *}%%,*} )
zstyle ':completion:*' hosts $_myhosts

# Completion fuer kill
zstyle ':completion:*:kill:*' menu yes select
zstyle ':completion:*:kill:*' force-list always
zstyle ':completion:*:processes' command 'ps -A'

# Fix Delete Key
bindkey '^[[3~' delete-char

# Ein kleiner calculator
alias calc="noglob _calc"
function _calc () {
awk "BEGIN { print $* ; }"
}

setopt auto_cd
setopt correct
export HISTSIZE=1000
export SAVEHIST=1000
export HISTFILE=~/.zhistory
setopt inc_append_history

alias ls="ls --color=always -h"
alias nc="netcat"
alias emerge="sudo emerge"
alias standby="sudo acpitool -s"
alias halt="sudo halt"
alias reboot="sudo reboot"
alias q="exit"

# Aliases damit grc funktioniert. (colorizing)
alias cl='/usr/bin/grc -es --colour=on'
alias configure='cl ./configure'
alias diff='cl diff'
alias make='cl make'
alias gcc='cl gcc'
alias g++='cl g++'
alias as='cl as'
alias gas='cl gas'
alias ld='cl ld'
alias netstat='cl netstat'
alias ping='cl ping'
alias traceroute='cl /usr/sbin/traceroute'
alias flagedit='cl sudo flagedit'

# Diverser Kram beim Terminal-Start
date "+%A %d %B %Y"
echo " "
pal -c 0 -x 1 -r 7
echo -n $CYAN_F
fortune -e -s
echo -n $NORM_F
 
Meine .zshrc und .zshenv stammen zwar nicht zu 100% aus meiner Feder, aber sie sind soweit gut, wie ich finde:

.zshrc
Code:
autoload run-help
autoload zmv
HELPDIR=~/zsh_help
zmodload zsh/complist
zmodload zsh/computil
zmodload zsh/mathfunc
autoload compinit
compinit
setopt listpacked
setopt  auto_cd
setopt  always_to_end
setopt  auto_continue
setopt  complete_aliases
setopt  complete_in_word
setopt  extended_glob
setopt  extended_history

zstyle ':completion:*:*:cd:*' tag-order local-directories
zstyle ':completion:*:*:lp*:*' tag-order jobs
zstyle ':completion:*:*:(kill|wait):*' tag-order 'jobs processes'
zstyle ':completion:*:*:(kill|wait):*' group-order jobs
zstyle ':completion:*:*' users-hosts \
       foo@bar.com \
       baz@foobar.net
zstyle ':completion:*' use-compctl false
zstyle ':completion:*:match:*' original yes
zstyle ':completion:incremental:*' list yes
zstyle ':completion:incremental:*' prompt 'incremental (%c): %u%s%a  %l'
zstyle ':completion:*:oldlist:*' menu verbose
zstyle ':completion:predict:*' completer _complete
zstyle ':completion:predict:*' list always
zstyle ':completion:predict:*' cursor key
zstyle ':completion:predict:*' special-dirs yes
zstyle ':completion:*:default' menu select
zstyle ':completion:*:(correct|approximate):*' max-errors 2 numeric
zstyle ':completion:*:(correct|approximate)-*:*' original yes
zstyle ':completion:*:paths' expand prefix
zstyle ':completion:*:option(-*|s)' auto-description 'specify %d'
zstyle ':completion:*:processes' command ps --forest -u $EUID -o pid,cmd
zstyle ':completion:*' verbose yes
zstyle ':completion:*' prefix-needed yes
zstyle ':completion:*' prefix-hidden no
zstyle ':completion:*' last-prompt yes
zstyle ':completion:*' users foo baz root
zstyle ':completion:*:complete:*:(all-|)files' ignored-patterns \
      '?*~' '?*.(o|log|aux|elc|reg|pro|md[dh]|mdh[is]|syms|epro)' '(|*/)CVS'
zstyle ':completion:*:complete:*:(local|path)-directories' ignored-patterns '(|*/)CVS'
zstyle ':completion:*' group-name ''
zstyle ':completion:*:jobs' prefix-needed no
zstyle ':completion:*' ignore-parents pwd parent
zstyle ':completion:*:complete:*:(functions|parameters|association-keys)' ignored-patterns '_*'
zstyle ':completion:::::' completer _complete _match _ignored _correct _approximate _prefix
zstyle ':completion:*' matcher-list '' 'm:{a-z-}={A-Z_} r:|[-_./]=* r:|=*' 'm:{a-z-}={A-Z_} l:|=* r:|=*'
zstyle ':completion:*:*:diff:*:version' command =diff -v
zstyle ':completion:*:*:(p|gview|xdvi|kill|psnup):*' menu yes select
zstyle ':completion:*' file-sort name
zstyle ':completion:*:*:(p|gview|xdvi|psnup):*' file-sort time
zstyle ':completion:*:default' list-prompt 'Line %l  Continue?                                                                       %b'
zstyle ':completion:*:default' select-prompt 'Match %m  Line %l  %p                                                                                  %b'
zstyle ':completion:*:(cp|mv|rm):*' ignore-line yes
zstyle ':completion:*:kill:*' force-list always
zstyle ':completion:*:*:*make:*:targets' command awk \''/^[a-zA-Z0-9][^\/\t=]+:/ {print $1}'\' \$file
zstyle ':completion:*history*' remove-all-dups yes
zstyle ':completion:*history*' stop yes
zstyle ':completion:*:default' list-colors 'tc=35' 'ma=41;37' 'st=43;36' 'di=31;1' 'ex=33;1' \
                                           'ln=32' '*CVS=35' '*rej=31;1' '*orig=35'
zstyle ':completion:*:processes' list-colors \
       '=(#b)( #[0-9]#)[^[/0-9a-zA-Z]#(*)=34=37;1=30;1'
zstyle ':completion:*:parameters' list-colors '=_*=33' '=[^a-zA-Z]*=31'
zstyle ':completion:*:functions' list-colors '=_*=33' '=*-*=31'
zstyle ':completion:*:original' list-colors '=*=31;1'
zstyle ':completion:*:all-expansions' list-colors '=*=32'
zstyle ':completion:*:reserved-words' list-colors '=*=31'
zstyle ':completion:*:(jobs|directory-stack|indexes)' list-colors \
       '=(#b)(*) -- (*)=35;1=31;1=33;1'
zstyle ':completion:*:(options|values)' list-colors \
       '=(#b)(*)-- (*)=35;1=31;1=33;1' '=*=31;1'
zstyle ':completion:*::lp*:jobs' list-colors '=(#b)* [0-9] ##([^    ]##) ##([^  ]##) ##([^  ]##) ##(*)=35=32=31;1=33;1=32'                                                              
zstyle ':completion:*' use-cache on
zstyle ':completion:*' cache-path ~/.zsh/cache

zstyle ':completion:*:*:ogg123:*' file-patterns '*.(ogg|OGG):ogg\ files *(-/):directories'
zstyle ':completion:*:*:xine:argument-rest:*' file-patterns '%p|*.m3u(-.):globbed-files *(-/):directories' '*:all-files'
compdef _mplayer xine
zstyle ':completion:*:*:wine:*' file-patterns '*.exe: *(-/):directories'
zstyle ':completion:*:*:cedega:*' file-patterns '*.exe: *(-/):directories'
zstyle ':completion:*:*:mid:*' file-patterns '*.mid: *.MID: *.kar: *.KAR: *(-/):directories'
zstyle ':completion:*:*:btc:*' file-patterns '*.torrent: *(-/):directories'


bindkey -M menuselect '/' accept-and-infer-next-history \
                      '^U' undo \
                      '^@' accept-and-menu-complete \
                      '^A' .beginning-of-line-hist \
                      '^E' .end-of-line-hist \
                      '^P' vi-forward-blank-word \
                      '^N' vi-backward-blank-word \
                      '\e<' beginning-of-history \
                      '\e>' end-of-history
bindkey '^[[3~' delete-char
bindkey '^Y'	backward-delete-word
bindkey '^[[8~' end-of-line
bindkey '^[[4~' end-of-line
bindkey '^[[1~' beginning-of-line
bindkey '^[[7~' beginning-of-line
bindkey '^[[5~' backward-word
bindkey '^[[6~' forward-word
bindkey '^[[2~' overwrite-mode
bindkey '^[1'	undo
bindkey '^[2'	redo
bindkey '^[b'	beep
bindkey '^[c'	transpose-words
bindkey '^[y'	transpose-chars
bindkey '^[[a'	up-history
bindkey '^[[b'	down-history
bindkey '^[s'	copy-prev-shell-word
bindkey "^[d" backward-delete-word
bindkey -M menuselect '^n' down-line-or-history
bindkey -M menuselect '^p' up-line-or-history
bindkey -M menuselect '^o' accept-and-infer-next-history

autoload -U     up-line-or-beginning-search
zle      -N     up-line-or-beginning-search
bindkey '^p'    up-line-or-beginning-search

autoload -U     down-line-or-beginning-search
zle      -N     down-line-or-beginning-search
bindkey '^n'    down-line-or-beginning-search


autoload -U url-quote-magic
zle -N self-insert url-quote-magic

autoload -U pick-web-browser

zstyle ':completion:*:options' description 'yes'
zstyle ':completion:*:options' auto-description '%B%d%b'
zstyle ':completion:*' expand 'yes'
zstyle ':completion:*' squeeze-slashes 'yes'

.zshenv
Code:
alias ls='ls --color=auto'
export NOSPLASH=1
export NOWELCOME=1
if [ '$TERM == rxvt ' ]
then
TERM=xterm
else
fi
HISTSIZE=100000
SAVEHIST=100000
HISTFILE=~/.history
DIRSTACKSIZE=1000
cdpath=(~ .)
ulimit -u 1024
export SCUMMVM_PORT=65:0
export PATH=$PATH:/usr/X11R6/bin:/opt/bin:/usr/local/bin:/bin:/opt/gnome/bin:
export MPD_HOST=192.168.0.4
export MPD_PORT=6600
export LESS="-R"
alias ncmpc="ncmpc --host=192.168.0.4"
alias irssi="if pgrep irssi; then; screen -x "irssi"; else; screen -S "irssi" irssi;fi"
alias centericq="if pgrep centericq; then; screen -x "centericq"; else; screen -S "centericq" centericq;fi"
alias urx="urxvtc -tr -fn 'xft:Terminus:pixelsize=13' -fg white -fade 30 -sh 40 -cr red -sr -tint white -bg black"
alias mrx='mrxvt -o 30 -od 100 +tr  +trs +trt -j -sr -ss sgi -sw -bgfade 50 -fade 60 -fg white -bg black -tabfg white -cr navy -xftfn "Bitstream Vera Sans Mono" -xftnfm -xft -xftht -xftaa -xftah -xftrgb rgb -xftsz 11 -tt "Tab" -bt -bc'
alias -g ...='../..' 
alias -g ....='../../..' 
alias -g .....='../../../..' 
alias -g ......='../../../../..' 
alias -g .......='../../../../../..'
alias -g DN=/dev/null
alias -g DZ=/dev/zero
alias -g DU=/dev/urandom
alias -g halt=/sbin/halt
WHITE=`print -P "%{\e[0;37m%}"`
BLACK=`print -P "%{\e[0;30m%}"`
RED=`print -P "%{\e[0;31m%}"`
GREEN=`print -P "%{\e[0;37m%}"`
YELLOW=`print -P "%{\e[0;37m%}"`
BLUE=`print -P "%{\e[0;37m%}"`
PURPLE=`print -P "%{\e[0;37m%}"`
CYAN=`print -P "%{\e[0;37m%}"`
export WHITE BLACK RED GREEN YELLOW BLUE PURPLE CYAN
function precmd {
#INFO=" (${freierspeicher} free)"
#freierspeicher=`df -h . | /usr/bin/tail -n1 | tr -s " " " " | cut -d" " -f4`
export PS1="%{${WHITE}%}%(!.%{${RED}%}%n. %{${RED}%}%n)%{${WHITE}%}//%{${RED}%}%m %{${WHITE}%}|%{${WHITE}%}%~${INFO}%# "}
export RPS1="%{${WHITE}%}|%{${WHITE}%}%*%{${WHITE}%}%{${WHITE}%}"
export SPROMPT='%R ist nicht vorhanden, meinten sie vielleicht %r? '
export PS2="%{${WHITE}%}<--%_-->%"

SELECTMIN=5
ZLS_COLOURS='ma=7:di=0:ex=0:bd=0:cd=0:ln=0:so=0'

export PGPPATH=~/.gnupg

typeset -xUT LS_COLORS ls_colors
ls_colors=(
    "no=00"
    "fi=00"
    "di=00"
    "ln=00"
    "pi=00"
    "so=00"
    "bd=00"
    "cd=00"
    "or=00"
    "mi=00"
    "ex=00"

    "*.cmd=00"
    "*.exe=00"
    "*.sh=00"
    "*.csh=00"
    "*.bash=00"
    "*.zsh=00"

    "*.tar=00"
    "*.tgz=00"
    "*.arj=00"
    "*.taz=00"
    "*.lzh=00"
    "*.zip=00"
    "*.z=00"
    "*.Z=00"
    "*.gz=00"
    "*.bz2=00"
    "*.bz=00"
    "*.tz=00"

    "*.rpm=00"
    "*.cpio=00"

    "*.jpg=00"
    "*.gif=00"
    "*.bmp=00"
    "*.xbm=00"
    "*.xpm=00"
    "*.png=00"
    "*.tif=00"

    "*#=00"
    "*%=00"
    "*~=00"

    "*README*=00"
    "*eadme*=00"
    "*eadme.jp*=00"
    "*EADME.jp*=00"

    "*.c=00"
    "*.cc=00"
    "*.cpp=00"
    "*.C=00"
    "*.cxx=00"
    "*.o=00"
    "*.h=00"
    "*.java=00"
    "*.class=00"

    "*akefile=00"
    "*akefile.linux=00"
    "*akefile.in=00"
    "*akefile.am=00"
    "*onfigure.in=00"

    "*.html=00"
    "*.htm=00"
    "*.shtml=00"
    "*.tex=00"
    "*.lyx=00"
    "*.mgp=00"
    "*.pl=00"
    "*.eps=00"
    "*.ppm=00"
    "*.tif=00"

    "*.ogg=00"
    "*.flac=00"
    "*.mp3=00"
    "*.wav=00"
    "*.mpg=00"
    "*.MPG=00"
    "*.mpeg=00"
    "*.MPEG=00"
    "*.avi=00"
    "*.AVI=00"
    "*.rm=00"
    "*.RM=00"
    "*.ram=00"
    "*.RAM=00"
    "*.wmv=00"
    "*.WMV=00"

#    ${ls_colors}
)

typeset -x PAGER=less
typeset -x MANPAGER=${PAGER}
typeset -x READNULLCMD=${PAGER}
typeset -x NULLCMD=cat
typeset -x EDITOR="xemacs -nw"
typeset -x MALLOC_CHECK=2
typeset -x USER=${USERNAME}
typeset -x HOSTNAME=${HOST}

alias   -s txt=${PAGER}
alias   -s dvi=xdvi
alias   -s pdf=xpdf
alias   -s ps=gv
alias   -s c=cc
alias   -s cpp=c++
alias   -s cc=c++
alias   -s C=c++
alias   -s tex=TEX

alias   -s ogg=mplayer
alias   -s flac=mplayer
alias   -s wav=mplayer
alias   -s wmv=mplayer
alias   -s mpg=mplayer
alias   -s mp3=mplayer
alias   -s avi=mplayer


alias   -s rm=xine
alias   -s ram=xine
alias   -s html=pick-web-browser
alias   -s jpg=display
alias   -s jpeg=display
alias   -s xpm=display
alias   -s xbm=display
alias   -s png=display
alias   -s gif=display

grüße
 
Code:
# cd und list
cdd () { cd ${1} ; echo $PWD ; ls -lh --color ; }
alias cd='cdd

Sehr praktisch!

Code:
# remove mit purge und ohne
 remove (){
  echo "Konfigurationsdateien löschen? j/n"
  read var

if [ $var = "j" ]; then
 apt-get remove --purge ${1}
  elif [ $var = "n" ]; then
 apt-get remove ${1}
fi
}

 alias uinst='remove'

Um den Grad der Deinstallation im Griff zu haben.

Code:
## search durch less, weils ohne Funktion nicht geht
 search (){
 apt-cache search ${1}|less;
}
 alias srch='search

Es geht wirklich nicht, ohne Funktion. Ich habs probiert.

Code:
 alias reinst='apt-get install ${1} --reinstall'
 alias upd='apt-get update'
 alias upgrd='apt-get upgrade'
 alias show='apt-cache show'

Is klar!
 

Ähnliche Themen

Shell Skript beschleunigen

Ich mag Dovecot nicht ...

Automatisierung via Netzwerk funktioniert nicht richtig

Xubuntu-Update scheiterte-13.04 nach 13.10 frostet ein.

Gnome Classic Desktop: Home-Inhalt Icons ausblenden

Zurück
Oben