aboutsummaryrefslogtreecommitdiff
path: root/sh/profile.d
diff options
context:
space:
mode:
Diffstat (limited to 'sh/profile.d')
-rw-r--r--sh/profile.d/visual.sh9
1 files changed, 7 insertions, 2 deletions
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