Using a single emacs instance from multiple (virtual) machines

1.3k views Asked by At

I love emacsclient. It allows me to use a single Emacs frame for all my editing, also when programs want to open an editor (i.e. export EDITOR=emacsclient).

I'd like to have it work like this with virtual machines, too. I can use tramp to edit remote files with Emacs in my single-frame setup, and it works very well, but it's not enough. When I invoke git commit or sudoedit, I'll have to use the crappy terminal-based editor that happens to be installed on the remote machine.

So, is there anything like emacsclient that works across multiple machines?

2

There are 2 answers

3
phils On BEST ANSWER

Speculation: If you can ssh from the VM back to your local machine then the VM could probably invoke emacsclient on your local machine, with the appropriate tramp prefix to the remote file? Set up a script for that, and configure your remote EDITOR environment variable to match.

0
Joseph Gay On

It could be you can do more with TRAMP than you think. First off, you may have noticed that /sudo: doesn't work for remote boxes, but TRAMP allows you to proxy to a remote box and then use any supported protocol, so in effect you can use /sudo: on a remote box. See tramp-default-proxies-alist.

You mentioned invoking git commit on a remote box. Have you considered using one of the Emacs git interfaces such as magit? They will work through TRAMP as well.