From d5d135a739001fb52538518d15b698042bed62dc Mon Sep 17 00:00:00 2001 From: Spotlight Date: Sat, 10 Aug 2019 11:50:55 -0500 Subject: [PATCH] .../../.../...../ --- zsh/expand-multiple-dots.zsh | 22 ++++++++++++++++++++++ zshrc | 5 +++++ 2 files changed, 27 insertions(+) create mode 100644 zsh/expand-multiple-dots.zsh diff --git a/zsh/expand-multiple-dots.zsh b/zsh/expand-multiple-dots.zsh new file mode 100644 index 0000000..1c45c4c --- /dev/null +++ b/zsh/expand-multiple-dots.zsh @@ -0,0 +1,22 @@ +function expand-multiple-dots() { + local MATCH + if [[ $LBUFFER =~ '(^| )\.\.\.+' ]]; then + LBUFFER=$LBUFFER:fs%\.\.\.%../..% + fi +} + +function expand-multiple-dots-then-expand-or-complete() { + zle expand-multiple-dots + zle expand-or-complete +} + +function expand-multiple-dots-then-accept-line() { + zle expand-multiple-dots + zle accept-line +} + +zle -N expand-multiple-dots +zle -N expand-multiple-dots-then-expand-or-complete +zle -N expand-multiple-dots-then-accept-line +bindkey '^I' expand-multiple-dots-then-expand-or-complete +bindkey '^M' expand-multiple-dots-then-accept-line diff --git a/zshrc b/zshrc index f32db74..708e396 100644 --- a/zshrc +++ b/zshrc @@ -14,6 +14,7 @@ zplug "zsh-users/zsh-completions", defer:2 bindkey "$terminfo[kcuu1]" history-beginning-search-backward bindkey "$terminfo[kcud1]" history-beginning-search-forward +source $HOME/.zsh/expand-multiple-dots.zsh # cd .../.../? setopt prompt_subst # Make sure prompt is able to be generated properly. setopt auto_cd # Get that ~ in here. setopt hist_ignore_all_dups # Goodbye, random duplicates. @@ -121,3 +122,7 @@ fi if [ -d $HOME/.ghcup ]; then export PATH="$HOME/.cabal/bin:$HOME/.ghcup/bin:$PATH" fi + +if [ -d $HOME/.fastlane ]; then + export PATH="$HOME/.fastlane/bin:$PATH" +fi