From a4112f4caa22e09690139889cf0b4270c892d062 Mon Sep 17 00:00:00 2001 From: Dimitriye Danilovic Date: Sun, 14 Jun 2015 15:06:43 -0700 Subject: [PATCH] Replace `.` aliases with as-you-type expansion Replace aliases: * `...` * `....` * `.....` * `......` with as-you-type auto-expansion. --- lib/directories.zsh | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/lib/directories.zsh b/lib/directories.zsh index 3bffa9fd..69427b0d 100644 --- a/lib/directories.zsh +++ b/lib/directories.zsh @@ -3,10 +3,16 @@ setopt auto_pushd setopt pushd_ignore_dups setopt pushdminus -alias -g ...='../..' -alias -g ....='../../..' -alias -g .....='../../../..' -alias -g ......='../../../../..' +resolve-dot() { + if [[ $LBUFFER = *.. ]]; then + LBUFFER+=/.. + else + LBUFFER+=. + fi +} +zle -N resolve-dot +bindkey . resolve-dot +bindkey -M isearch . self-insert alias 1='cd -' alias 2='cd -2'