From be1bb85f3c6cb2a1b0632128898e0fe32fabcc2f Mon Sep 17 00:00:00 2001 From: Florian Pritz Date: Sat, 21 Nov 2009 11:55:56 +0100 Subject: zshrc: only replace ... for cd Signed-off-by: Florian Pritz --- .zshrc | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/.zshrc b/.zshrc index 9abfd38..34a1c45 100644 --- a/.zshrc +++ b/.zshrc @@ -73,15 +73,19 @@ bindkey "^[[B" history-beginning-search-forward # for some actions run `bindkey` # "cd......" ;) -rationalise-dot() { - if [[ $LBUFFER = *.. ]]; then - LBUFFER+=/.. - else - LBUFFER+=. - fi +_rationalise-dot() { + if [[ $LBUFFER = "cd "* ]]; then + if [[ $LBUFFER = *.. ]]; then + LBUFFER+=/.. + else + LBUFFER+=. + fi + else + LBUFFER+=. + fi } -zle -N rationalise-dot -bindkey . rationalise-dot +zle -N _rationalise-dot +bindkey . _rationalise-dot # add edit command line feature ("alt-e") autoload edit-command-line -- cgit v1.2.3-24-g4f1b