From 12dff6de62cef80a65752697687d66572c810478 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Tue, 12 May 2020 20:31:12 +1200 Subject: Try a compatibility switch on vi/vim --- sh/profile.d/visual.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'sh/profile.d') diff --git a/sh/profile.d/visual.sh b/sh/profile.d/visual.sh index 50b8b423..19c8f490 100644 --- a/sh/profile.d/visual.sh +++ b/sh/profile.d/visual.sh @@ -1,3 +1,8 @@ -# For a visual editor, use whichever kind of vi we get when we invoke 'vi' -VISUAL='vi' +# For a visual editor, use Vim explicitly if we've got it, but otherwise any vi +# implementation will be fine +if command -v vim >/dev/null 2>&1 ; then + VISUAL='vim' +else + VISUAL='vi' +fi export VISUAL -- cgit v1.2.3