diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2020-05-12 20:31:12 +1200 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2020-05-12 20:32:26 +1200 |
commit | 12dff6de62cef80a65752697687d66572c810478 (patch) | |
tree | 0206be3c0f453614d929ef13575129016647611a /sh/profile.d | |
parent | Fine-tune perlcritic/perltidy installs (diff) | |
download | dotfiles-12dff6de62cef80a65752697687d66572c810478.tar.gz dotfiles-12dff6de62cef80a65752697687d66572c810478.zip |
Try a compatibility switch on vi/vim
Diffstat (limited to 'sh/profile.d')
-rw-r--r-- | sh/profile.d/visual.sh | 9 |
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 |