summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bashrc/common/env.sh9
1 files changed, 8 insertions, 1 deletions
diff --git a/bashrc/common/env.sh b/bashrc/common/env.sh
index e02e6ad..2ddb235 100644
--- a/bashrc/common/env.sh
+++ b/bashrc/common/env.sh
@@ -1,5 +1,12 @@
# force sane editor
-export EDITOR=/usr/bin/nano
+editor="nano vim emacsclient"
+
+for b in $editor ; do
+ if hash $b > /dev/null 2>&1 ; then
+ export EDITOR="$(which $b)"
+ break
+ fi
+done
# set timezone if needed
[[ -z "$TZ" ]] && export TZ=Europe/Berlin