# -- David Faure (inspire de Cedric Maion) . ~/.zprompting # Variables watch=(all) WATCHFMT='[%T tty%l] %S%n%s has %a%(M: from %M:)' MAILCHECK=60 LOGCHECK=60 TEXINPUTS=~/txt: export EDITOR=vi export BROWSER=konqueror export HISTSIZE=5000 export HISTFILESIZE=5000 export HISTFILE=~/.zsh_history export SAVEHIST=5000 export NNTPSERVER=news #export XKB_DISABLE= export READNULLCMD=less path=($path ~dfaure/txt/setup/bin /d/kdab/src/kdabtools/Scripts /usr/X11R6/bin) # Key bindings bindkey -e bindkey ' ' magic-space bindothers=0 if [ "$TERM" = 'linux' ]; then bindkey "\e[1~" beginning-of-line bindkey "\e[4~" end-of-line bindothers=1 elif [ "$TERM" = 'xterm' ]; then export TERM='xterm-color' fi if [ "$TERM" = 'xterm-color' ]; then # pour mutt, entre autres #stty erase  bindkey "\e[1~" beginning-of-line bindkey "\e[4~" end-of-line # kde3 konsole: bindkey "\e[H" beginning-of-line bindkey "\e[F" end-of-line # kde2 konsole, iirc: bindkey "\e[7~" beginning-of-line bindkey "\e[8~" end-of-line bindothers=1 elif test "$TERM" = 'screen'; then bindkey "\e[3~" backward-delete-char elif test -z "$TERM"; then echo $0: TERM was not set fi if [ $bindothers = 1 ]; then bindkey "\e[2~" overwrite-mode bindkey "\e[3~" delete-char bindkey "\e[5~" history-beginning-search-backward bindkey "\e[6~" history-beginning-search-forward fi unset bindothers # bindkey "\C-t" insert-last-word bindkey "\C-b" vi-match-bracket bindkey "\C- " set-mark-command # Debian messup test -f /etc/debian_version && bindkey '^?' backward-delete-char # Somehow mdk-2006.1 changed the default to "executables and dirs are both blue!". # Apply my own settings again. export LS_COLORS='no=00:fi=00:di=01;34:ln=01;36:pi=40;33:so=01;35:bd=40;33;01:cd=40;33;01:or=01;05;37;41:mi=01;05;37;41:ex=01;32:*.cmd=01;32:*.exe=01;32:*.com=01;32:*.btm=01;32:*.bat=01;32:*.sh=01;32:*.csh=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.gz=01;31:*.bz2=01;31:*.bz=01;31:*.tz=01;31:*.rpm=01;31:*.cpio=01;31:*.jpg=01;35:*.gif=01;35:*.bmp=01;35:*.xbm=01;35:*.xpm=01;35:*.png=01;35:*.tif=01;35:' # Aliases if [ "$TERM" != "dumb" ] && \ [ "$TERM" != "tvi950" ] && [ "$TERM" != "tvi950-4p" ] && [ "$TERM" != "adm31" ] then alias ls="ls --color=auto" fi alias l="ls -l" alias ll="ls -al" alias lll="ls -al | less -r" alias llm="ls -al | more" alias lth='ls -lt --color=yes $* | head' alias d="dirs -v" alias du="du -h" alias df="df -h -xtmpfs -xusbfs" alias h="history -1000" alias ..="cd .." alias ...='cd ${PWD%/*/*}' alias ....='cd ${PWD%/*/*/*}' alias .....='cd ${PWD%/*/*/*}' alias ......='cd ${PWD%/*/*/*/*}' alias '/'='cd /' alias p=popd # l includes PPID. u shows readable username. Hmm, I need my own -o format maybe? alias psg='nocorrect ps awwlx | grep -v grep | grep -v "ps awwlx" | grep $*' alias psgme='nocorrect ps awwlx | grep -v grep | grep -v "ps awwlx" | grep "^[0-9][ ]*"$UID | grep $*' # Note that pgrep is a similar solution: it shows the pids of the processes with a given name, # not grepping the arguments, and only showing the pid. # List mounts of real volumes, not all the linux-internal stuff (tmpfs, devfs, sysfs etc.) alias lsmount="mount -l | \grep '\['" alias lsm=lsmount alias scp='rsync --progress -v -a -e "ssh -x"' alias diff='diff -u' export GREP_COLOR='01;35' alias grep='grep --color=auto' alias rgrep='rgrep -r' # or use wcgrep instead alias gdb='gdb -nw' alias ck='( test -d .svn && svn status --ignore-externals ) || ( test -d CVS && cvscheck $* ) || echo "no CVS or SVN here"' alias su='nocorrect su' alias locate='nocorrect locate' alias which='nocorrect which' alias ncftp='nocorrect ncftp' alias ftp='nocorrect ftp' alias ln='nocorrect ln' alias xv='xli -gamma 2.2' alias xview=xv # Options #setopt AUTO_MENU setopt nohup setopt AUTO_LIST setopt AUTO_PUSHD setopt PUSHD_IGNORE_DUPS setopt PUSHD_SILENT setopt CORRECT_ALL setopt NO_BEEP unsetopt MAIL_WARNING unsetopt FLOW_CONTROL # Do not nice apps running in the background, like xemacs! unsetopt BG_NICE # Write into history immediately setopt INC_APPEND_HISTORY # Aurelien showed me: history with timestamps setopt EXTENDED_HISTORY alias history='history -fED' # setopt NULL_GLOB ouch ls blabla* affiche tout, avec ca... # useful stuff for **/blah # ============================================================================ # This code is copyright © 2000 Kevin McCarty. # (See http://www.princeton.edu/~kmccarty/email.html to contact me.) # You may use it under the terms of the GNU General Public License. # bls: "big ls" bls () { bls_MOREFLAGS=1 # change the following to suit your tastes: bls_DEFAULTFLAGS=('-F' '--color=auto') # First, determine how many words in the command are flags. count=1 while ((count <= $#)) && [[ $*[count] == \-* ]] && ((bls_MOREFLAGS)) do if [[ $*[count] == '--' ]] then bls_MOREFLAGS=0 ; fi ((count++)) ; done # The number of words which are flags is now count - 1. # Now put the flags and files in separate arrays if ((count > 1)) then set -A bls_FLAGLIST $*[1,((count - 1))] ; else bls_FLAGLIST=() ; fi set -A bls_FILELIST $*[count,-1] ; # If bls was called sans arguments, just use ls directly; else use xargs. # The -N argument to "print" does the same thing as find's -print0. if [[ $#bls_FILELIST == 0 ]] then ls $bls_DEFAULTFLAGS $bls_FLAGLIST ; else print -N -- $bls_FILELIST | xargs -0 \ ls $bls_DEFAULTFLAGS $bls_FLAGLIST ; fi # clean up unset bls_DEFAULTFLAGS bls_FLAGLIST bls_FILELIST bls_MOREFLAGS count } # bgrep: "big grep" bgrep () { bgrep_MOREFLAGS=1 bgrep_LOOKFORPATTERN=1 # change the following to suit your tastes: bgrep_DEFAULTFLAGS=() # Determine how many words in the command are flags. count=1 while ((count <= $#)) && [[ $*[count] == \-* ]] && ((bgrep_MOREFLAGS)) do case $*[count] in # The -A, -B, -d, -e, and -f flags to grep require a parameter. # Also, if grep is given an -e or -f flag, it can't take a pattern. ('-e'|'-f') bgrep_LOOKFORPATTERN=0 ;& # fall through ('-A'|'-B'|'-d') if ((count < $#)) then ((count++)) ; fi ;; # The -C flag has an optional numeric parameter. ('-C') if ((count < $#))&& [[ $*[((count + 1))] == <-> ]] then ((count++)) ; fi ;; # If --, no more flags. ('--') bgrep_MOREFLAGS=0 ;; esac ((count++)) ; done # The number of words which are flags is now count - 1. # Now create separate arrays for the flags and files, and store the pattern if ((count > 1)) then set -A bgrep_FLAGLIST $*[1,((count - 1))] ; else bgrep_FLAGLIST=() ; fi if ((bgrep_LOOKFORPATTERN)) then bgrep_PATTERN=$*[count] set -A bgrep_FILELIST $*[((count + 1)),-1] ; else bgrep_PATTERN='' set -A bgrep_FILELIST $*[count,-1] ; fi # If bgrep_FILELIST has zero length, just call grep normally. if [[ $#bgrep_FILELIST == 0 ]] then grep $bgrep_DEFAULTFLAGS $bgrep_FLAGLIST $bgrep_PATTERN ; else print -N -- $bgrep_FILELIST | xargs -0 \ grep $bgrep_DEFAULTFLAGS $bgrep_FLAGLIST $bgrep_PATTERN ; fi # clean up unset bgrep_DEFAULTFLAGS bgrep_FLAGLIST bgrep_FILELIST bgrep_PATTERN \ bgrep_MOREFLAGS bgrep_LOOKFORPATTERN count }