]> code.delx.au - dotfiles/blobdiff - .bash/environment
screenrc rewrite
[dotfiles] / .bash / environment
index 647f6a6a4c0377b64848c5a4c68ce8b724acc3f4..e14b4e9721a872e3f9d32dd62ce2dac037257d51 100644 (file)
@@ -13,12 +13,24 @@ fi
 
 # General environment settings
 export PAGER="less"
-export EDITOR="vim"
-export CVS_RSH="ssh"
-export RSYNC_RSH="ssh"
 export PYTHONSTARTUP="${HOME}/.pythonrc.py"
 export EMAIL="James Bunton <jamesbunton@delx.net.au>"
 
+# Editor settings
+if emacsclient --version &> /dev/null; then
+    export ALTERNATE_EDITOR="vim"
+    export EDITOR="emacsclient --tty"
+
+    if [[ "$TERM" == screen* ]]; then
+        export EDITORBG="$EDITOR"
+    else
+        export EDITORBG="emacsclient --create-frame --no-wait"
+    fi
+else
+    export EDITOR="vim"
+    export EDITORBG="vim"
+fi
+
 # Expand any symbolic links in the TMPDIR environment variable
 [ -n "$TMPDIR" ] && export TMPDIR="$(cd "${TMPDIR}" && pwd -P)"