aboutsummaryrefslogtreecommitdiff
path: root/bash/bashrc.d/vim.bash
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2015-05-31 15:52:10 +1200
committerTom Ryder <tom@sanctum.geek.nz>2015-05-31 15:52:10 +1200
commit0a95c126e8853996d4025a9d2ad8aab735b5bc05 (patch)
tree0fde3a21a878a9e88c9cac9ca45f420dd29e9047 /bash/bashrc.d/vim.bash
parentConsistent color count method (diff)
downloaddotfiles-0a95c126e8853996d4025a9d2ad8aab735b5bc05.tar.gz
dotfiles-0a95c126e8853996d4025a9d2ad8aab735b5bc05.zip
Avoid condition definition of functions
Diffstat (limited to 'bash/bashrc.d/vim.bash')
-rw-r--r--bash/bashrc.d/vim.bash23
1 files changed, 13 insertions, 10 deletions
diff --git a/bash/bashrc.d/vim.bash b/bash/bashrc.d/vim.bash
index 9b598192..4584ae1d 100644
--- a/bash/bashrc.d/vim.bash
+++ b/bash/bashrc.d/vim.bash
@@ -1,13 +1,16 @@
# If Vim exists on the system, use it instead of ex, vi, and view
-if hash vim 2>/dev/null ; then
- ex() {
- command vim -e "$@"
- }
- vi() {
- command vim "$@"
- }
- view() {
- command vim -R "$@"
- }
+if ! hash vim 2>/dev/null ; then
+ return
fi
+# Define functions proper
+ex() {
+ command vim -e "$@"
+}
+vi() {
+ command vim "$@"
+}
+view() {
+ command vim -R "$@"
+}
+