nutools/em

25 lines
482 B
Bash
Executable File

#!/bin/bash
# -*- coding: utf-8 mode: sh -*- vim:sw=4:sts=4:et:ai:si:sta:fenc=utf-8
EMACS_GEOMETRY=150x50+0+67
# Essayer avec emacs
emacs="$(which emacs 2>/dev/null)"
if [ -x "$emacs" ]; then
if [ -n "$DISPLAY" ]; then
exec "$emacs" -g "$EMACS_GEOMETRY" "$@" &
exit 0
else
exec "$emacs" "$@"
fi
fi
# puis avec vim
vim="$(which vim 2>/dev/null)"
[ -x "$vim" ] && exec "$vim" "$@"
# puis avec $EDITOR
[ -n "$EDITOR" ] && exec "$EDITOR"
exit 1