From c31a3da9ffaf7eab7d75577ac8d5e634a590d99b 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"