SSH-only server administration: Vim’s sub-second startup and tiny memory footprint make it the default choice for editing config files on remote boxes, containers, and minimal Linux images where every extra process matters. It’s also nearly guaranteed to already be installed, since most base Linux and macOS images ship Vim or vi by default, unlike Emacs, which almost always requires a separate install step.
That's one way to do it. A better way to accomplish this with emacs is to use tramp mode which uses ssh as a tunnel to edit remote files in a local emacs instance. It just needs ssh access and doesn't require emacs to be installed remotely.
yea, vim doesn't have that, and you don't have to check if vim/emacs is installed on the remote box. just use tramp and if you have ssh access to the files, so does emacs.
Comments
That's one way to do it. A better way to accomplish this with emacs is to use tramp mode which uses ssh as a tunnel to edit remote files in a local emacs instance. It just needs ssh access and doesn't require emacs to be installed remotely.
How do you escalate up from your user to make changes to root owned files? Or do you ssh in as root?
When I used to do this, I bound 'sudo-find-file to a key, then called that to re-open as root.
I suspect that this may be an example in the tramp docs, as I definitely wasn't knowledgeable enough to figure it out for myself.
I tend to ssh in as root, but TRAMP also supports escalating with su, sudo, or sudoedit (or doas).
yea, vim doesn't have that, and you don't have to check if vim/emacs is installed on the remote box. just use tramp and if you have ssh access to the files, so does emacs.
In that situation I’d rather use sshfs and whatever editor I’m fancying the most for the job.