aliases/vim: use _command_exists
This commit is contained in:
@@ -2,11 +2,7 @@
|
|||||||
cite 'about-alias'
|
cite 'about-alias'
|
||||||
about-alias 'vim abbreviations'
|
about-alias 'vim abbreviations'
|
||||||
|
|
||||||
VIM=$(command -v vim)
|
if _command_exists vim; then
|
||||||
GVIM=$(command -v gvim)
|
|
||||||
MVIM=$(command -v mvim)
|
|
||||||
|
|
||||||
if [[ -n $VIM ]]; then
|
|
||||||
alias v='$VIM'
|
alias v='$VIM'
|
||||||
# open the vim help in fullscreen incorporated from
|
# open the vim help in fullscreen incorporated from
|
||||||
# https://stackoverflow.com/a/4687513
|
# https://stackoverflow.com/a/4687513
|
||||||
@@ -17,9 +13,9 @@ fi
|
|||||||
# http://stackoverflow.com/questions/936501/let-gvim-always-run-a-single-instancek
|
# http://stackoverflow.com/questions/936501/let-gvim-always-run-a-single-instancek
|
||||||
case $OSTYPE in
|
case $OSTYPE in
|
||||||
darwin*)
|
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
|
esac
|
||||||
|
|||||||
Reference in New Issue
Block a user