From e85505af7cbd87d8d512e5e76d025f9a5b9be53a Mon Sep 17 00:00:00 2001 From: PowerUser64 Date: Sat, 25 Jun 2022 16:50:35 -0700 Subject: [PATCH] zsh: unalias safely (lol gonna have to merge cause I wrote it twice) --- .zshrc | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.zshrc b/.zshrc index adeff6a..88c01b9 100644 --- a/.zshrc +++ b/.zshrc @@ -59,7 +59,8 @@ ${SKIP_PLUGINS:-false} || { ## Theme # terminal colors - #zinit snippet 'https://github.com/chriskempson/base16-shell/blob/master/scripts/base16-onedark.sh' + [ -f "$SHELL_CONFIG_DIR/colors.sh" ] || + zinit snippet 'https://github.com/chriskempson/base16-shell/blob/master/scripts/base16-onedark.sh' # LS Colors zinit ice atclone"dircolors -b ./src/dir_colors > colors.zsh" \ @@ -77,8 +78,10 @@ ${SKIP_PLUGINS:-false} || { # clear plugin options set at the start of this block unalias zinit - # just gonna sneak this in here too - alias zi > /dev/null && unalias zi zpl zini zplg which-command run-help fsh-alias + # (safely) delete a bunch of aliases I don't use + unaliases() { for A in "$@";do alias "$A" > /dev/null && unalias "$A"; done; } + unaliases zi zpl zini zplg which-command run-help fsh-alias + unset -f unaliases } # <<< }