utiliser vim ou EDITOR si emacs n'est pas installé
This commit is contained in:
parent
d86717bfd3
commit
c61126ec0b
20
em
20
em
|
@ -1,11 +1,23 @@
|
||||||
#!/bin/sh
|
#!/bin/bash
|
||||||
# -*- coding: utf-8 mode: sh -*- vim:sw=4:sts=4:et:ai:si:sta:fenc=utf-8
|
# -*- coding: utf-8 mode: sh -*- vim:sw=4:sts=4:et:ai:si:sta:fenc=utf-8
|
||||||
|
|
||||||
GEOMETRY=150x50+0+67
|
EMACS_GEOMETRY=150x50+0+67
|
||||||
|
|
||||||
emacs="`which emacs`"
|
# Essayer avec emacs
|
||||||
|
emacs="$(which emacs 2>/dev/null)"
|
||||||
|
if [ -x "$emacs" ]; then
|
||||||
if [ -n "$DISPLAY" ]; then
|
if [ -n "$DISPLAY" ]; then
|
||||||
exec "$emacs" -g $GEOMETRY "$@" &
|
exec "$emacs" -g "$EMACS_GEOMETRY" "$@" &
|
||||||
else
|
else
|
||||||
exec "$emacs" "$@"
|
exec "$emacs" "$@"
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
# puis avec vim
|
||||||
|
vim="$(which vim 2>/dev/null)"
|
||||||
|
[ -x "$vim" ] && exec "$vim" "$@"
|
||||||
|
|
||||||
|
# puis avec $EDITOR
|
||||||
|
[ -n "$EDITOR" ] && exec "$EDITOR"
|
||||||
|
|
||||||
|
exit 1
|
||||||
|
|
Loading…
Reference in New Issue