From: Mark Wooding Date: Thu, 16 Mar 2006 11:08:56 +0000 (+0000) Subject: bash_profile: Find a useful editor automatically. X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~mdw/git/profile/commitdiff_plain/97b82392cfd7d7b62069dec34756e5d079f78a2e?ds=sidebyside;hp=-c bash_profile: Find a useful editor automatically. --- 97b82392cfd7d7b62069dec34756e5d079f78a2e diff --git a/bash_profile b/bash_profile index 64a85f1..50d5542 100644 --- a/bash_profile +++ b/bash_profile @@ -101,7 +101,16 @@ umask 002 unset LANG -export EDITOR="emacs -nw"; export VISUAL="$EDITOR" +export EDITOR=ed +for ed in "emacs21 -nw" "emacs -nw" vi pico nano ae; do + name=`echo $ed | sed 's/ .*$//'` + if type -t >/dev/null "$name"; then + EDITOR=$ed + break + fi +done +export VISUAL="$EDITOR" + export TEXINPUTS=".:$HOME/lib/tex//:" __mdw_addto INFOPATH r $HOME/info /usr/info /usr/share/info /usr/local/info