diff options
Diffstat (limited to 'sh/profile.d')
-rw-r--r-- | sh/profile.d/visual.sh | 26 |
1 files changed, 5 insertions, 21 deletions
diff --git a/sh/profile.d/visual.sh b/sh/profile.d/visual.sh index f79158b8..d5280abd 100644 --- a/sh/profile.d/visual.sh +++ b/sh/profile.d/visual.sh @@ -1,24 +1,8 @@ -# If an Emacs is installed, and ~/.emacs exists, use emacs as the visual -# editor; otherwise, use the system's vi -if command -v emacs >/dev/null 2>&1 && - [ -f "$HOME"/.emacs ] ; then - - # Use or start a GNU Emacs client, if possible - if command -v pgrep >/dev/null 2>&1 && - pgrep -fxu "$USER" 'emacs --daemon' >/dev/null || - emacs --daemon 2>/dev/null ; then - VISUAL=emacsclient - - # If no GNU Emacs daemon is available, just create a new instance every - # time - else - VISUAL=emacs - fi - -# If an Emacs isn't installed, just use good old vi +# If my Emacs wrapper is installed, use emacs as the visual editor; otherwise, +# use the system's vi +if command -v emacsm >/dev/null 2>&1 ; then + VISUAL='emacsm' else - VISUAL=vi + VISUAL='vi' fi - -# Export final editor decision export VISUAL |