zshrc: Remove rundirs
[grml-etc-core.git] / etc / zsh / zshrc
index 6b30222..0cafc3e 100644 (file)
@@ -2944,13 +2944,6 @@ if is439 && [[ -d /dev/disk/by-id/ ]]; then
     }
 fi
 
-#f5# run command or function in a list of directories
-rundirs() {
-  local d CMD STARTDIR=$PWD
-  CMD=$1; shift
-  ( for d ($@) {cd -q $d && { print cd $d; ${(z)CMD} ; cd -q $STARTDIR }} )
-}
-
 # Translate DE<=>EN
 # 'translate' looks up fot a word in a file with language-to-language
 # translations (field separator should be " : "). A typical wordlist looks
@@ -2977,42 +2970,6 @@ trans() {
     esac
 }
 
-#f5# List all occurrences of programm in current PATH
-plap() {
-    emulate -L zsh
-    if [[ $# = 0 ]] ; then
-        echo "Usage:    $0 program"
-        echo "Example:  $0 zsh"
-        echo "Lists all occurrences of program in the current PATH."
-    else
-        ls -l ${^path}/*$1*(*N)
-    fi
-}
-
-# Found in the mailinglistarchive from Zsh (IIRC ~1996)
-#f5# Select items for specific command(s) from history
-selhist() {
-    emulate -L zsh
-    local TAB=$'\t';
-    (( $# < 1 )) && {
-        echo "Usage: $0 command"
-        return 1
-    };
-    cmd=(${(f)"$(grep -w $1 $HISTFILE | sort | uniq | pr -tn)"})
-    print -l $cmd | less -F
-    echo -n "enter number of desired command [1 - $(( ${#cmd[@]} - 1 ))]: "
-    local answer
-    read answer
-    print -z "${cmd[$answer]#*$TAB}"
-}
-
-# Use vim to convert plaintext to HTML
-#f5# Transform files to html with highlighting
-2html() {
-    emulate -L zsh
-    vim -u NONE -n -c ':syntax on' -c ':so $VIMRUNTIME/syntax/2html.vim' -c ':wqa' $1 &>/dev/null
-}
-
 # Usage: simple-extract <file>
 # Using option -d deletes the original archive file.
 #f5# Smart archive extractor
@@ -3207,50 +3164,6 @@ show-archive() {
     fi
 }
 
-# It's shameless stolen from <http://www.vim.org/tips/tip.php?tip_id=167>
-#f5# Use \kbd{vim} as your manpage reader
-vman() {
-    emulate -L zsh
-    if (( ${#argv} == 0 )); then
-        printf 'usage: vman <topic>\n'
-        return 1
-    fi
-    man "$@" | col -b | view -c 'set ft=man nomod nolist' -
-}
-
-# function readme() { $PAGER -- (#ia3)readme* }
-#f5# View all README-like files in current directory in pager
-readme() {
-    emulate -L zsh
-    setopt extendedglob
-    local files
-    files=(./(#i)*(read*me|lue*m(in|)ut|lies*mich)*(NDr^/=p%))
-    if (($#files)) ; then
-        $PAGER $files
-    else
-        print 'No README files.'
-    fi
-}
-
-# function ansi-colors()
-#f5# Display ANSI colors
-ansi-colors() {
-    typeset esc="\033[" line1 line2
-    echo " _ _ _40 _ _ _41_ _ _ _42 _ _ 43_ _ _ 44_ _ _45 _ _ _ 46_ _ _ 47_ _ _ 49_ _"
-    for fore in 30 31 32 33 34 35 36 37; do
-        line1="$fore "
-        line2="   "
-        for back in 40 41 42 43 44 45 46 47 49; do
-            line1="${line1}${esc}${back};${fore}m Normal ${esc}0m"
-            line2="${line2}${esc}${back};${fore};1m Bold   ${esc}0m"
-        done
-        echo -e "$line1\n$line2"
-    done
-}
-
-#f5# Find all files in \$PATH with setuid bit set
-suidfind() { ls -latg $path | grep '^...s' }
-
 # TODO: So, this is the third incarnation of this function!?
 #f5# Reload given functions
 refunc() {
@@ -3261,132 +3174,6 @@ refunc() {
 }
 compdef _functions refunc
 
-# a small check to see which DIR is located on which server/partition.
-# stolen and modified from Sven's zshrc.forall
-#f5# Report diskusage of a directory
-dirspace() {
-    emulate -L zsh
-    if [[ -n "$1" ]] ; then
-        for dir in "$@" ; do
-            if [[ -d "$dir" ]] ; then
-                ( cd $dir; echo "-<$dir>"; du -shx .; echo);
-            else
-                echo "warning: $dir does not exist" >&2
-            fi
-        done
-    else
-        for dir in $path; do
-            if [[ -d "$dir" ]] ; then
-                ( cd $dir; echo "-<$dir>"; du -shx .; echo);
-            else
-                echo "warning: $dir does not exist" >&2
-            fi
-        done
-    fi
-}
-
-# % slow_print `cat /etc/passwd`
-#f5# Slowly print out parameters
-slow_print() {
-    for argument in "$@" ; do
-        for ((i = 1; i <= ${#1} ;i++)) ; do
-            print -n "${argument[i]}"
-            sleep 0.08
-        done
-        print -n " "
-    done
-    print ""
-}
-
-#f5# Show some status info
-status() {
-    print
-    print "Date..: "$(date "+%Y-%m-%d %H:%M:%S")
-    print "Shell.: Zsh $ZSH_VERSION (PID = $$, $SHLVL nests)"
-    print "Term..: $TTY ($TERM), ${BAUD:+$BAUD bauds, }$COLUMNS x $LINES chars"
-    print "Login.: $LOGNAME (UID = $EUID) on $HOST"
-    print "System: $(cat /etc/[A-Za-z]*[_-][rv]e[lr]*)"
-    print "Uptime:$(uptime)"
-    print
-}
-
-# Rip an audio CD
-#f5# Rip an audio CD
-audiorip() {
-    mkdir -p ~/ripps
-    cd ~/ripps
-    cdrdao read-cd --device $DEVICE --driver generic-mmc audiocd.toc
-    cdrdao read-cddb --device $DEVICE --driver generic-mmc audiocd.toc
-    echo " * Would you like to burn the cd now? (yes/no)"
-    read input
-    if [[ "$input" = "yes" ]] ; then
-        echo " ! Burning Audio CD"
-        audioburn
-        echo " * done."
-    else
-        echo " ! Invalid response."
-    fi
-}
-
-# and burn it
-#f5# Burn an audio CD (in combination with audiorip)
-audioburn() {
-    cd ~/ripps
-    cdrdao write --device $DEVICE --driver generic-mmc audiocd.toc
-    echo " * Should I remove the temporary files? (yes/no)"
-    read input
-    if [[ "$input" = "yes" ]] ; then
-        echo " ! Removing Temporary Files."
-        cd ~
-        rm -rf ~/ripps
-        echo " * done."
-    else
-        echo " ! Invalid response."
-    fi
-}
-
-#f5# Make an audio CD from all mp3 files
-mkaudiocd() {
-    # TODO: do the renaming more zshish, possibly with zmv()
-    emulate -L zsh
-    cd ~/ripps
-    for i in *.[Mm][Pp]3; do mv "$i" `echo $i | tr '[A-Z]' '[a-z]'`; done
-    for i in *.mp3; do mv "$i" `echo $i | tr ' ' '_'`; done
-    for i in *.mp3; do mpg123 -w `basename $i .mp3`.wav $i; done
-    normalize -m *.wav
-    for i in *.wav; do sox $i.wav -r 44100 $i.wav resample; done
-}
-
-#f5# Create an ISO image. You are prompted for\\&\quad volume name, filename and directory
-mkiso() {
-    emulate -L zsh
-    echo " * Volume name "
-    read volume
-    echo " * ISO Name (ie. tmp.iso)"
-    read iso
-    echo " * Directory or File"
-    read files
-    mkisofs -o ~/$iso -A $volume -allow-multidot -J -R -iso-level 3 -V $volume -R $files
-}
-
-#f5# Simple thumbnails generator
-genthumbs() {
-    rm -rf thumb-* index.html
-    echo "
-<html>
-  <head>
-    <title>Images</title>
-  </head>
-  <body>" > index.html
-    for f in *.(gif|jpeg|jpg|png) ; do
-        convert -size 100x200 "$f" -resize 100x200 thumb-"$f"
-        echo "    <a href=\"$f\"><img src=\"thumb-$f\"></a>" >> index.html
-    done
-    echo "
-  </body>
-</html>" >> index.html
-}
-
 #f5# Set all ulimit parameters to \kbd{unlimited}
 allulimit() {
     ulimit -c unlimited