From 47edb094f802c93fa985510347f90e29a006371c Mon Sep 17 00:00:00 2001 From: Chris Date: Fri, 4 Apr 2025 07:43:26 +0100 Subject: [PATCH] Allow disabling alias check --- .config/zsh/.zshrc | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) 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