←back to thread

Making TRAMP faster

(coredumped.dev)
226 points celeritascelery | 8 comments | | HN request time: 1.056s | source | bottom
1. shwouchk ◴[] No.44357887[source]
tramp is great. all the other mentioned solutions are nowhere near as seamless for “just do what i want, without distractions”.

vscode? “trust me bro, i will run a networked daemon on your server”. enjoy wondering which plugins to reinstall on your remote. enjoy installing proprietary shareware+telemetry plugins just to use git. try opening a local file and a remote file side by side in the same window. wifi connection broke for a sec? oops, you have to refresh the whole browser window.

want to edit a single file on a host you rarely connect to? enjoy spending 10 minutes setting up autosync solutions.

with any of the above - oops, you actually need sudo for that file in /etc? yeah, drop to shell and edit in vim.

there are other options to do stuff and for very specific predefined workflows they may win, but the versatility of tramp is still unmatched, especially if you do use emacs.

the only times ive had issues is when i have a weird shell setup on the remote - for that there is /sshx: instead of /ssh:

replies(2): >>44359279 #>>44366365 #
2. graemep ◴[] No.44359279[source]
What about mounting a remote file system over sftp? Install EMACS or whatever editor you prefer on the remote?
replies(2): >>44359784 #>>44361778 #
3. chriswarbo ◴[] No.44359784[source]
> What about mounting a remote file system over sftp?

That can be OK for some tasks, but not others. For example, TRAMP will execute commands on the remote; so commands like M-x find-grep-dired will be faster when using TRAMP.

> Install EMACS or whatever editor you prefer on the remote?

There's actually a lot of flexibility there, since Emacs is perfectly usable in a text terminal, which could be run over SSH; it can also show X11 windows over the network (though I recommend the "lucid" build, rather than GTK); and it also has a client/server mode.

4. shwouchk ◴[] No.44361778[source]
installing an editor on the remote sure works - my mention of vim was not an accident, it is my preferred remote editor. some of us are bitextual ;-) - but then you lose the seamless remote+local editing, need to sync your config, potentially clash with someone else’s (ever ssh into ubuntu@awshost?), take special care not to sync any private stuff, etc.

as for sftp, unfortunately that’s not an option if you happen to use windows locally eg for work reasons, nor if you use a mac as of several years now, since fuse became closed source.

not to mention, again, the fact that you are limited to whatever root you decided to mount, limited to editing as a user that i’ve already mentioned, as well as limited from using remote tools as sibling stated. try making a git commit over sftp.

if you have a focused “working on a project” workflow it may work, otherwise PITA

replies(1): >>44363687 #
5. graemep ◴[] No.44363687{3}[source]
I suppose I fail to see the advantages because I have never had a need to keep remote and local synced as I go. Its always been work on local and sync to remote, with editing on a remote for very specific and limited things.
replies(1): >>44365247 #
6. shwouchk ◴[] No.44365247{4}[source]
i was replying to “install your preferred editor on the remote” - without syncing your config, you might as well just use vim even if it’s not your favorite.

most of my remote editing fits into your description. of course, if you’re not an emacs user, you likely won’t find much value in tramp, magit, org-mode, dired, ediff, eshell, etc

7. warsheep ◴[] No.44366365[source]
Not sure how you can compare vscode with TRAMP. A lot of dev work nowdays is done in containers where you install specific versions of dev tools, compilers, etc. Vscode is one click from seamlessly working inside such a container with its dev tools. TRAMP doesn't provide anything like that, right?
replies(1): >>44367593 #
8. G3rn0ti ◴[] No.44367593[source]
Of course, you can use TRAMP to edit files inside docker containers. You don’t even need to install anything inside them.