summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xssn.at>2009-11-21 11:55:56 +0100
committerFlorian Pritz <bluewind@xssn.at>2009-11-21 11:55:56 +0100
commitbe1bb85f3c6cb2a1b0632128898e0fe32fabcc2f (patch)
treec307d0f34a53b8bae9ad6bec1d0a0ff0621975e0
parented7ccf5a00dc6788bc01145bd825afd8f2aa99cc (diff)
downloaddotfiles-be1bb85f3c6cb2a1b0632128898e0fe32fabcc2f.tar.gz
dotfiles-be1bb85f3c6cb2a1b0632128898e0fe32fabcc2f.tar.xz
zshrc: only replace ... for cd
Signed-off-by: Florian Pritz <bluewind@xssn.at>
-rw-r--r--.zshrc20
1 files 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