diff --git a/.zshrc b/.zshrc index 36c3d8b..8dd0b70 100644 --- a/.zshrc +++ b/.zshrc @@ -74,6 +74,30 @@ bindkey "^[[1;5C" forward-word bindkey "^[[1;5D" backward-word bindkey -s "^X" 'n^M' +### ---- EXPAND DOTS ------------------------------------- +function expand-dots() { + local MATCH + if [[ $LBUFFER =~ '(^| )\.\.\.+' ]]; then + LBUFFER=$LBUFFER:fs%\.\.\.%../..% + fi +} + +function expand-dots-then-expand-or-complete() { + zle expand-dots + zle expand-or-complete +} + +function expand-dots-then-accept-line() { + zle expand-dots + zle accept-line +} + +zle -N expand-dots +zle -N expand-dots-then-expand-or-complete +zle -N expand-dots-then-accept-line +bindkey '^I' expand-dots-then-expand-or-complete +bindkey '^M' expand-dots-then-accept-line + ### ---- THEMES ----------------------------------- PS1='%B%F{red}%n@%m%k %B%F{cyan}%(4~|...|)%3~%F{white} %# %b%f%k'