From d035ca94de50b1b47b1ec85f57d9e1e718273571 Mon Sep 17 00:00:00 2001 From: Alpha Chen Date: Tue, 24 Nov 2020 14:56:02 -0800 Subject: [PATCH] use `$commands` instead of `type` because it's faster --- runcoms/zshrc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/runcoms/zshrc b/runcoms/zshrc index 9ee990d..58fe7eb 100644 --- a/runcoms/zshrc +++ b/runcoms/zshrc @@ -30,7 +30,7 @@ alias tmux="direnv exec / tmux" function eject { command hdiutil eject `df | grep Volumes | grep -i "$@" | ruby -ne 'puts $_[/^[^ ]*/]'`; } -if type chruby > /dev/null; then +if [ $commands[chruby] ]; then chruby ruby fi @@ -41,7 +41,7 @@ if [ -e /usr/local/opt/fzf/shell/completion.zsh ]; then source /usr/local/opt/fzf/shell/completion.zsh fi -if type fzf > /dev/null; then +if [ $commands[fzf] ]; then export FZF_DEFAULT_COMMAND="rg --files" export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND" export FZF_ALT_C_COMMAND="find . -type d"