From 2733d6b5b810dc582b2f6fd1c75b11e72a6ffc9d Mon Sep 17 00:00:00 2001 From: Henry Bley-Vroman Date: Mon, 6 Apr 2020 21:12:37 -0400 Subject: [PATCH] feat(git aliases): skip function aliases --- zsh-abbr.zsh | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/zsh-abbr.zsh b/zsh-abbr.zsh index 175607ca..c7c1afef 100755 --- a/zsh-abbr.zsh +++ b/zsh-abbr.zsh @@ -264,12 +264,16 @@ _zsh_abbr() { key=${${git_alias%% *}#alias.} value=${git_alias#* } - if ! (( ZSH_ABBR_INITIALIZING )); then - abbreviation=${(q)abbreviation} - expansion=${(q)expansion} - fi + if [[ ${value[1]} == '!' || ${${(z)value}[1]} == 'git' ]]; then + echo "Skipped\n $git_alias\n" + else + if ! (( ZSH_ABBR_INITIALIZING )); then + abbreviation=${(q)abbreviation} + expansion=${(q)expansion} + fi - _zsh_abbr:util_add "g$key" "git $value" + _zsh_abbr:util_add "g$key" "git $value" + fi done if ! (( dry_run )); then