aboutsummaryrefslogtreecommitdiff
path: root/sh/profile.d/visual.sh
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2020-05-12 20:31:12 +1200
committerTom Ryder <tom@sanctum.geek.nz>2020-05-12 20:32:26 +1200
commit12dff6de62cef80a65752697687d66572c810478 (patch)
tree0206be3c0f453614d929ef13575129016647611a /sh/profile.d/visual.sh
parentf101f2c9cf9d27e5733edee2250a8d7f0f5e2725 (diff)
downloaddotfiles-12dff6de62cef80a65752697687d66572c810478.tar.gz
dotfiles-12dff6de62cef80a65752697687d66572c810478.zip
Try a compatibility switch on vi/vim
Diffstat (limited to 'sh/profile.d/visual.sh')
-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