diff options
-rw-r--r-- | .zshrc | 20 |
1 files changed, 12 insertions, 8 deletions
@@ -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 |