summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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