Some thoughts on (not) using GNU Emacs' Tramp remote editing system

Tramp is a famous and often praised GNU Emacs system for editing remote files; lots of people will call it one of Emacs' compelling features. As part of a big GNU Emacs renovation earlier this year, I made Tramp actually work for me , and at that point I expected that it would be a curiosity and I'd mostly not use it. That has half worked out the way I expected, and the other half is that I'm editing this Wandering Thoughts entry with Tramp, as I have most of my entries since then.

For various reasons, including that I now read my email mostly through GNU Emacs , I have a full GNU Emacs environment set up on our login servers, complete with the same custom build of GNU Emacs that I run on my desktops and the same Emacs Lisp. Under normal circumstances I'd rather use that Emacs (either with or without X forwarding) rather than wrestle with Tramp, because Tramp is getting me relatively little but is adding complexity (and it may be slower in practice to use a local Emacs with Tramp but a remote LSP server, because LSP servers are kind of chatty). There are some situations where I want to try using Tramp (for example, using compare-windows to compare the same file from two different machines, but they're uncommon and I haven't gotten around to it yet.

(Tramp can work with LSP servers, Git, and so on, but all of them are run remotely, which means if you have a remote Emacs too you have all of the pieces you need for a good remote Emacs environment. And there's stuff that's easy to make work locally but awkward over TRAMP .)

Tramp has a certain number of appealing additional features for system administrators specifically, such as using su and other programs to edit root-only files , especially over SSH. If you want to use a fully set up Emacs environment (ideally your regular one) but still edit root owned files, Tramp can let you do that, and it can even let you do that on remote machines where you aren't installing GNU Emacs to start with. This can help bypass some of the reasons that vi became my sysadmin's editor , assuming that you trust (your) GNU Emacs with holding and using sensitive passwords and probably have an instance running all the time. I don't use GNU Emacs that way (and I don't really trust it with sensitive passwords), so this aspect of Tramp isn't interesting to me. After years of using vi as a sysadmin's editor , I've become fluid in vim and I'd often rather use it than GNU Emacs.

However, the host of Wandering Thoughts doesn't have my Emacs or my Emacs environment, and I'm not going to put either on it. Not maintaining your Emacs environment on a remote host but still using Emacs to edit files there is a good use of Tramp, and for obvious reasons the whole experience is quite snappy when you're just editing text files; the only time a remote connection gets involved is when I save the file (which I actually do a lot, it's a reflex). I don't think Vim is better or worse than Emacs for editing entries, but they are different, and right now I apparently mildly prefer the modern GNU Emacs editing experience (in X, where I get nice red squiggle underlines for words the spell checker doesn't recognize and various other niceties).

(It's petty of me, but one irritation of local editing of entries with Vim is that I reflow paragraphs in Vim with '!}fmt', and the version of fmt on the host believes very firmly in two spaces after periods and I don't. I was forever going back to turn them into single spaces. GNU Emacs does it right for my tastes, although its reflow behavior is not quite what I want in other ways. There's definitely some aspects of the Vim editing experience I like better than the Emacs one.)

I've also been using the various editing actions I want for writing Wandering Thoughts entries as excuses to learn various GNU Emacs features, currently Rectangles . Rectangles are roughly the GNU Emacs equivalent of Vim's block visual selection mode and it's handy to know them, even if I find them somewhat more awkward than in Vim.

(There are so many keystrokes and every so often I will fumble a C-x r <something> operation and have to back to re-establish the rectangle selection I just lost. In the GNU Emacs way, there may be a package, command, or setting that would do this for me, but I'd have to find it.)