Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Use emacsclient for editing remote files by setting this script as EDITOR in the remote machine
# Use this script as your EDITOR to allow editing remote files with emacsclient.
# Works by connecting to the Emacs machine with SSH and using a suitable tramp prefix.
# How to reach this machine from the one that's running Emacs
# How to reach the machine that's running Emacs from this machine
if [ "${1#/}" != "$1" ]; then
# absolute path
exec ssh $THEY "emacsclient /$ME:$1"
# relative path
exec ssh $THEY "emacsclient /$ME:$PWD/$1"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment