diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2013-10-16 20:58:21 +1300 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2013-10-16 20:58:21 +1300 |
commit | 74b457d9719df8ca810de9cbf964784ccee5b866 (patch) | |
tree | b77c25505788411564ac5aaa9194a22fd781a488 /bash/bashrc.d/vim.bash | |
parent | Add completion for pass(1) (diff) | |
download | dotfiles-74b457d9719df8ca810de9cbf964784ccee5b866.tar.gz dotfiles-74b457d9719df8ca810de9cbf964784ccee5b866.zip |
Check for presence of binaries before script setup
Diffstat (limited to 'bash/bashrc.d/vim.bash')
-rw-r--r-- | bash/bashrc.d/vim.bash | 23 |
1 files changed, 8 insertions, 15 deletions
diff --git a/bash/bashrc.d/vim.bash b/bash/bashrc.d/vim.bash index bcdcd86d..f6109602 100644 --- a/bash/bashrc.d/vim.bash +++ b/bash/bashrc.d/vim.bash @@ -1,23 +1,16 @@ +# Bail if no vim(1) +if ! hash vim 2>/dev/null; then + return +fi + # If Vim exists on the system, use it instead of ex, vi, and view ex() { - if hash vim 2>/dev/null; then - command vim -e "$@" - else - command ex "$@" - fi + command vim -e "$@" } vi() { - if hash vim 2>/dev/null; then - command vim "$@" - else - command vi "$@" - fi + command vim "$@" } view() { - if hash vim 2>/dev/null; then - command vim -R "$@" - else - command view "$@" - fi + command vim -R "$@" } |