From bf839e5e3054fcc7f20f49eb1630a7dc9ed49b13 Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Wed, 14 Mar 2007 15:42:17 +0100 Subject: [PATCH] /etc/zsh/zshrc: added rationalise-dot --- debian/changelog | 9 +++++++++ etc/zsh/zshrc | 13 ++++++++++++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 7dfe66e..0b25727 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,12 @@ +grml-etc-core (0.2.30) unstable; urgency=low + + * /etc/zsh/zshrc: added rationalise-dot (just type 'cd ...' to + get 'cd ../..'). Taken from Christian Schneider: + http://strcat.de/blog/archives/707-Schnelles-Verzeichniswechseln.html + Thanks for pointing, schula. + + -- Michael Prokop Wed, 14 Mar 2007 15:41:08 +0100 + grml-etc-core (0.2.29) unstable; urgency=low * /etc/skel/.zshrc: remove duplicate cl() definition, thanks - Jens diff --git a/etc/zsh/zshrc b/etc/zsh/zshrc index c764991..1fb1f24 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: Mon Feb 26 18:52:32 CET 2007 [mika] +# Latest change: Mit Mär 14 15:41:03 CET 2007 [mika] ################################################################################ # This file is sourced only for interactive shells. It # should contain commands to set up aliases, functions, @@ -146,6 +146,17 @@ fi zle -N insert-unicode-char bindkey '^Xi' insert-unicode-char +# just type 'cd ...' to get 'cd ../..' + rationalise-dot() { + if [[ $LBUFFER = *.. ]]; then + LBUFFER+=/.. + else + LBUFFER+=. + fi + } + zle -N rationalise-dot + bindkey . rationalise-dot + # bindkey '\eq' push-line-or-edit # }}} -- 2.1.4