changeset 463:1a3f8dff1214

editor: if it looks like I'm over ssh, use vi not emacs
author Augie Fackler <raf@durin42.com>
date Mon, 26 Jun 2017 09:26:59 -0400
parents fff281929b47
children 84f79f34bd63
files .shell.d/50.editorsetup.sh
diffstat 1 files changed, 7 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/.shell.d/50.editorsetup.sh
+++ b/.shell.d/50.editorsetup.sh
@@ -1,4 +1,10 @@
 export ALTERNATE_EDITOR=$HOME/unixSoft/otherbin/emacs.sh
 alias e='emacsclient -n'
 alias ee='emacsclient'
-export EDITOR=emacsclient
+if [ -z "$SSH_CONNECTION" ] ; then
+    # GUI session, use emacsclient
+    export EDITOR=emacsclient
+else
+    # SSH session
+    export EDITOR=vi
+fi