diff --git a/brethil_dotfile.sh b/brethil_dotfile.sh index 0b0dcb2..c919ae9 100755 --- a/brethil_dotfile.sh +++ b/brethil_dotfile.sh @@ -18,19 +18,19 @@ antibody bundle < "$DOTFILES/antibody_plugins.txt" source $DOTFILES/completion_style.zsh source $DOTFILES/extras/fzf-tab-config.zsh -if command -vp fd >/dev/null; then +if [[ $+commands[fd] ]]; then export FZF_CTRL_T_COMMAND='fd' else export FZF_CTRL_T_COMMAND='find' fi export FZF_CTRL_T_OPTS=" --preview-window=right,60% --preview \"bash -c 'if [[ -d \"{}\" ]]; then tree -C \"{}\"; else bat --style=plain --color=always \"{}\"; fi'\" --bind 'ctrl-/:change-preview-window(right,70%|down,40%,border-horizontal|hidden|right)'" -if [[ "$(command -v systemctl)" ]]; then +if [[ $+commands[systemctl] ]]; then antibody bundle robbyrussell/oh-my-zsh path:plugins/systemd fi -if [[ "$(command -v pacman)" ]]; then +if [[ $+commands[pacman] ]]; then antibody bundle robbyrussell/oh-my-zsh path:plugins/archlinux -elif [[ "$(command -v apt-get)" ]]; then +elif [[ $+commands[apt-get] ]]; then antibody bundle robbyrussell/oh-my-zsh path:plugins/debian fi @@ -82,12 +82,8 @@ export ZSH_AUTOSUGGEST_COMPLETION_IGNORE='* \#*' # prevent completion for commen # less options export LESS='-xRF-j12' # -j12: displays 12 lines before search results with / and ? -if [[ "$(command -v bat)" || "$(command -v batcat)" ]]; then - if [[ "$(command -v bat)" ]]; then - cmd=bat - else - cmd=batcat - fi +if [[ $+commands[bat] || $+commands[batcat] ]]; then + if [[ $+commands[bat] ]]; then cmd=bat else cmd=batcat fi alias cat=$cmd export PAGER=$cmd