X-Git-Url: http://git.grml.org/?a=blobdiff_plain;f=etc%2Fskel%2F.zshrc;h=323635004dc6468d7e42fbfcfa833b5ba5e365f6;hb=050227ae683e7b119f1f2a020afd9e49191460e4;hp=24555452b6fc38457127ccb17152eff2d199da30;hpb=538b20715841b392eb9b8f7a410546e78de57afa;p=grml-etc-core.git diff --git a/etc/skel/.zshrc b/etc/skel/.zshrc index 2455545..3236350 100644 --- a/etc/skel/.zshrc +++ b/etc/skel/.zshrc @@ -3,7 +3,7 @@ # Authors: grml-team (grml.org), (c) Michael Prokop # Bug-Reports: see http://grml.org/bugs/ # License: This file is licensed under the GPL v2. -# Latest change: Son Okt 22 21:25:17 CEST 2006 [mika] +# Latest change: Don Okt 26 00:50:18 CEST 2006 [mika] ################################################################################ # source ~/.zshrc.global {{{ @@ -82,6 +82,43 @@ alias -g V='| vim -' # }}} +## another approach for global aliases: cloning vim's abbreviation feature {{{ +# http://zshwiki.org/home/examples/zleiab +# typeset -A abbreviations +# abbreviations=( +# "Im" "| more" +# "Ia" "| awk" +# "Ig" "| grep" +# "Ieg" "| egrep" +# "Iag" "| agrep" +# "Igr" "| groff -s -p -t -e -Tlatin1 -mandoc" +# "Ip" "| $PAGER" +# "Ih" "| head" +# "Ik" "| keep" +# "It" "| tail" +# "Is" "| sort" +# "Iv" "| ${VISUAL:-${EDITOR}}" +# "Iw" "| wc" +# "Ix" "| xargs" +# ) +# +# magic-abbrev-expand() { +# local MATCH +# LBUFFER=${LBUFFER%%(#m)[_a-zA-Z0-9]#} +# LBUFFER+=${abbreviations[$MATCH]:-$MATCH} +# zle self-insert +# } +# +# no-magic-abbrev-expand() { +# LBUFFER+=' ' +# } +# +# zle -N magic-abbrev-expand +# zle -N no-magic-abbrev-expand +# bindkey " " magic-abbrev-expand +# bindkey "^x " no-magic-abbrev-expand +# }}} + ## aliases {{{ # Xterm resizing-fu. @@ -693,6 +730,7 @@ # get x-lite voip software getxlite() { + setopt local_options setopt errreturn [ -d ~/tmp ] || mkdir ~/tmp cd ~/tmp @@ -709,6 +747,7 @@ # get skype getskype() { + setopt local_options setopt errreturn echo "Downloading debian package of skype." echo "Notice: If you want to use a more recent skype version run 'getskypebeta'." @@ -718,6 +757,7 @@ # get beta-version of skype getskypebeta() { + setopt local_options setopt errreturn echo "Downloading debian package of skype (beta version)." wget http://www.skype.com/go/getskype-linux-beta-deb @@ -726,6 +766,7 @@ # get gzimo (voicp software) getgizmo() { + setopt local_options setopt errreturn echo "gconf2-common and libgconf2-4 have to be available. Installing therefor." $SUDO apt-get update @@ -736,6 +777,7 @@ # get AIR - Automated Image and Restore getair() { + setopt local_options setopt errreturn [ -w . ] || { echo 'Error: you do not have write permissions in this directory. Exiting.' ; return 1 } local VER='1.2.8' @@ -836,21 +878,22 @@ cd mercurial-tree echo "Running hg pull for retreiving latest version..." hg pull - echo "Finished update. Building tree now..." + echo "Finished update. Building mercurial" make local echo "Setting \$PATH to $PWD:\$PATH..." export PATH="$PWD:$PATH" else + echo "Downloading mercurial via hg" hg clone http://selenic.com/repo/hg mercurial-tree cd mercurial-tree + echo "Building mercurial" make local echo "Setting \$PATH to $PWD:\$PATH..." export PATH="$PWD:$PATH" - # echo "Setting \$PYTHONPATH to PYTHONPATH=\${HOME}/lib/python," echo "make sure you set it permanent via ~/.zshrc if you plan to use it permanently." + # echo "Setting \$PYTHONPATH to PYTHONPATH=\${HOME}/lib/python," # export PYTHONPATH=${HOME}/lib/python fi - setopt LOCAL_OPTIONS } fi # end of check whether we have the 'hg'-executable @@ -859,20 +902,23 @@ gethgsnap() { setopt local_options setopt errreturn - echo "Downloading mercurial snapshot" - wget http://www.selenic.com/mercurial/mercurial-snapshot.tar.gz + if [ -f mercurial-snapshot.tar.gz ] ; then + echo "mercurial-snapshot.tar.gz exists already, skipping download." + else + echo "Downloading mercurial snapshot" + wget http://www.selenic.com/mercurial/mercurial-snapshot.tar.gz + fi + echo "Unpacking mercurial-snapshot.tar.gz" tar zxf mercurial-snapshot.tar.gz cd mercurial-snapshot/ + echo "Installing required build-dependencies" $SUDO apt-get update $SUDO apt-get install python2.4-dev + echo "Building mercurial" make local - # make install-home-bin echo "Setting \$PATH to $PWD:\$PATH..." export PATH="$PWD:$PATH" - # echo "Setting \$PYTHONPATH to PYTHONPATH=\${HOME}/lib/python," - # export PYTHONPATH=${HOME}/lib/python echo "make sure you set it permanent via ~/.zshrc if you plan to use it permanently." - # echo "Notice: make sure \$HOME/bin is inside \$PATH!" } # }}}