diff --git a/.config/zsh/.zshrc b/.config/zsh/.zshrc index 0add306..b4d85db 100644 --- a/.config/zsh/.zshrc +++ b/.config/zsh/.zshrc @@ -99,7 +99,20 @@ preexec() { echo -ne '\e[5 q' } +function disable_alias_check() { + export DISABLE_ALIAS_CHECK=1 + echo "Alias check disabled." +} + +function enable-alias-check() { + unset DISABLE_ALIAS_CHECK + echo "Alias check enabled." +} + function alias_suggestion_check() { + if [[ $DISABLE_ALIAS_CHECK = 1 ]] { + return + } local current_cmd="$1" if [[ -z "$current_cmd" || ${#current_cmd} -lt 7 ]]; then @@ -114,6 +127,9 @@ function alias_suggestion_check() { preexec_functions+=(alias_suggestion_check) function remind_alias_if_exists() { + if [[ $DISABLE_ALIAS_CHECK = 1 ]] { + return + } local current_cmd="$1" if [[ -z "$current_cmd" || ${#current_cmd} -lt 7 ]]; then