diff options
author | Florian Pritz <bluewind@xssn.at> | 2009-11-21 11:55:56 +0100 |
---|---|---|
committer | Florian Pritz <bluewind@xssn.at> | 2009-11-21 11:55:56 +0100 |
commit | be1bb85f3c6cb2a1b0632128898e0fe32fabcc2f (patch) | |
tree | c307d0f34a53b8bae9ad6bec1d0a0ff0621975e0 | |
parent | ed7ccf5a00dc6788bc01145bd825afd8f2aa99cc (diff) | |
download | dotfiles-be1bb85f3c6cb2a1b0632128898e0fe32fabcc2f.tar.gz dotfiles-be1bb85f3c6cb2a1b0632128898e0fe32fabcc2f.tar.xz |
zshrc: only replace ... for cd
Signed-off-by: Florian Pritz <bluewind@xssn.at>
-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 |