From 757a5bf25bc6135b9d66082bbf5d86c3cac27f58 Mon Sep 17 00:00:00 2001 From: John D Pell Date: Thu, 9 Sep 2021 16:17:12 -0700 Subject: [PATCH] aliases/vim: use `_command_exists` --- aliases/available/vim.aliases.bash | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/aliases/available/vim.aliases.bash b/aliases/available/vim.aliases.bash index d19057d0..d5dcdc54 100644 --- a/aliases/available/vim.aliases.bash +++ b/aliases/available/vim.aliases.bash @@ -2,11 +2,7 @@ cite 'about-alias' about-alias 'vim abbreviations' -VIM=$(command -v vim) -GVIM=$(command -v gvim) -MVIM=$(command -v mvim) - -if [[ -n $VIM ]]; then +if _command_exists vim; then alias v='$VIM' # open the vim help in fullscreen incorporated from # https://stackoverflow.com/a/4687513 @@ -17,9 +13,9 @@ fi # http://stackoverflow.com/questions/936501/let-gvim-always-run-a-single-instancek case $OSTYPE in darwin*) - [[ -n $MVIM ]] && function mvimt { command mvim --remote-tab-silent "$@" || command mvim "$@"; } + _command_exists mvim && function mvimt { command mvim --remote-tab-silent "$@" || command mvim "$@"; } ;; *) - [[ -n $GVIM ]] && function gvimt { command gvim --remote-tab-silent "$@" || command gvim "$@"; } + _command_exists gvim && function gvimt { command gvim --remote-tab-silent "$@" || command gvim "$@"; } ;; esac