2011-09-25 13:45:51 -04:00
|
|
|
#!/bin/sh
|
|
|
|
# This script tries to exec an editor by trying some known editors if $EDITOR is
|
|
|
|
# not set.
|
|
|
|
#
|
|
|
|
# Distributions/packagers can enhance this script with a
|
|
|
|
# distribution-specific mechanism to find the preferred pager.
|
2011-11-19 09:10:39 -05:00
|
|
|
[ -n "$VISUAL" ] && which $VISUAL >/dev/null && exec $VISUAL "$@"
|
|
|
|
[ -n "$EDITOR" ] && which $EDITOR >/dev/null && exec $EDITOR "$@"
|
2011-09-25 13:45:51 -04:00
|
|
|
|
|
|
|
# Hopefully one of these is installed (no flamewars about preference please!):
|
|
|
|
which nano >/dev/null && exec nano "$@"
|
|
|
|
which vim >/dev/null && exec vim "$@"
|
|
|
|
which vi >/dev/null && exec vi "$@"
|
|
|
|
which emacs >/dev/null && exec emacs "$@"
|