From 0a95c126e8853996d4025a9d2ad8aab735b5bc05 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Sun, 31 May 2015 15:52:10 +1200 Subject: Avoid condition definition of functions --- bash/bashrc.d/vim.bash | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) (limited to 'bash/bashrc.d/vim.bash') 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 "$@" +} + -- cgit v1.2.3