aboutsummaryrefslogtreecommitdiff
path: root/sh/profile.d
diff options
context:
space:
mode:
Diffstat (limited to 'sh/profile.d')
-rw-r--r--sh/profile.d/editor.sh8
-rw-r--r--sh/profile.d/visual.sh8
2 files changed, 12 insertions, 4 deletions
diff --git a/sh/profile.d/editor.sh b/sh/profile.d/editor.sh
index ee0da70b..5d6b249e 100644
--- a/sh/profile.d/editor.sh
+++ b/sh/profile.d/editor.sh
@@ -1,3 +1,7 @@
-# Set command-line editor
-EDITOR=ed
+# Set command-line editor; ed if we've got it (!), but ex will do fine
+if command -v ed >/dev/null 2>&1 ; then
+ EDITOR=ed
+else
+ EDITOR=ex
+fi
export EDITOR
diff --git a/sh/profile.d/visual.sh b/sh/profile.d/visual.sh
index 95eb1d5d..d03da255 100644
--- a/sh/profile.d/visual.sh
+++ b/sh/profile.d/visual.sh
@@ -1,3 +1,7 @@
-# Set visual editor
-VISUAL=vi
+# Set visual editor; vim if we've got it, but vi will do fine
+if command -v vim >/dev/null 2>&1 ; then
+ VISUAL=vim
+else
+ VISUAL=vi
+fi
export VISUAL