aboutsummaryrefslogtreecommitdiff
path: root/bash/bashrc.d/vim.bash
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2013-10-16 20:58:21 +1300
committerTom Ryder <tom@sanctum.geek.nz>2013-10-16 20:58:21 +1300
commit74b457d9719df8ca810de9cbf964784ccee5b866 (patch)
treeb77c25505788411564ac5aaa9194a22fd781a488 /bash/bashrc.d/vim.bash
parentAdd completion for pass(1) (diff)
downloaddotfiles-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.bash23
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 "$@"
}