X-Git-Url: http://git.grml.org/?a=blobdiff_plain;f=etc%2Fzsh%2Fzshrc;h=17c47213b70970eb78deb57b7b77eeabf9894d26;hb=86b1cfde8fc6366532e11b671477d195a744dd27;hp=032704d78f0f3a18db4c8d7a47595e4116cb597f;hpb=11125ca5aec63c226a409ad59498f9875bb7b278;p=grml-etc-core.git diff --git a/etc/zsh/zshrc b/etc/zsh/zshrc index 032704d..17c4721 100644 --- a/etc/zsh/zshrc +++ b/etc/zsh/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: Fre Jun 29 11:46:37 CEST 2007 [mika] +# Latest change: Sam Jul 07 10:56:20 CEST 2007 [mika] ################################################################################ # This file is sourced only for interactive shells. It # should contain commands to set up aliases, functions, @@ -11,8 +11,8 @@ # # Global Order: zshenv, zprofile, zshrc, zlogin ################################################################################ -# -# zsh-refcard-tag documentation: + +# zsh-refcard-tag documentation: {{{ # You may notice strange looking comments in the zshrc (and ~/.zshrc as # well). These are there for a purpose. grml's zsh-refcard can now be # automatically generated from the contents of the actual configuration @@ -20,7 +20,7 @@ # and what lines of code to take into account (and for what purpose). # # Here is what they mean: -#{{{ +# # List of tags (comment types) used: # #a# Next line contains an important alias, that should # be included in the grml-zsh-refcard. @@ -567,6 +567,7 @@ fi setopt auto_pushd # make cd push the old directory onto the directory stack. setopt nonomatch # try to avoid the 'zsh: no matches found...' setopt nobeep # avoid "beep"ing + setopt pushd_ignore_dups # don't push the same dir twice. MAILCHECK=30 # mailchecks REPORTTIME=5 # report about cpu-/system-/user-time of command if running longer than 5 seconds @@ -601,7 +602,7 @@ fi # dirstack handling {{{ DIRSTACKSIZE=20 if [[ -f ~/.zdirs ]] && [[ ${#dirstack[*]} -eq 0 ]]; then - dirstack=( ${(uf)"$(< ~/.zdirs)"} ) + dirstack=( ${(f)"$(< ~/.zdirs)"} ) # "cd -" won't work after login by just setting $OLDPWD, so [[ -d $dirstack[0] ]] && cd $dirstack[0] && cd $OLDPWD fi @@ -789,6 +790,11 @@ ${BLUE}%n${NO_COLOUR}@%m %40<...<%B%~%b%<< %# " alias mdstat='cat /proc/mdstat' alias ...='cd ../../' + # generate alias named "$KERNELVERSION-reboot" so you can use boot with kexec: + if [ -x /sbin/kexec -a -r /proc/cmdline ] ; then + alias "$(uname -r)-reboot"="kexec -l --initrd=/boot/initrd.img-"$(uname -r)" --command-line=\"$(cat /proc/cmdline)\" /boot/vmlinuz-"$(uname -r)"" + fi + alias cp='nocorrect cp' # no spelling correction on cp alias mkdir='nocorrect mkdir' # no spelling correction on mkdir alias mv='nocorrect mv' # no spelling correction on mv @@ -833,6 +839,13 @@ ${BLUE}%n${NO_COLOUR}@%m %40<...<%B%~%b%<< %# " # I like clean prompt, so provide simple way to get that alias 0 &>/dev/null || functions 0 &>/dev/null || alias 0='return 0' +# for really lazy people like mika: + type S &>/dev/null || alias S='screen' + type s &>/dev/null || alias s='ssh' + +# get top 10 shell commands: + alias top10='print -l ? ${(o)history%% *} | uniq -c | sort -nr | head -n 10' + # truecrypt; use e.g. via 'truec /dev/ice /mnt/ice' or 'truec -i' if [ -x $(which truecrypt) ] ; then if isutfenv ; then @@ -1250,9 +1263,16 @@ If you want to use xinit anyway please call \"/usr/bin/xinit\"." dchange() { if [ -r /usr/share/doc/${1}/changelog.Debian.gz ] ; then most /usr/share/doc/${1}/changelog.Debian.gz + elif [ -r /usr/share/doc/${1}/changelog.gz ] ; then + most /usr/share/doc/${1}/changelog.gz else - if [ -r /usr/share/doc/${1}/changelog.gz ] ; then - most /usr/share/doc/${1}/changelog.gz + if type -p aptitude &>/dev/null ; then + echo "No changelog for package $1 found, using aptitude to retrieve it." + if isgrml ; then + aptitude -t unstable changelog ${1} + else + aptitude changelog ${1} + fi else echo "No changelog for package $1 found, sorry." return 1