←back to thread

Making TRAMP faster

(coredumped.dev)
226 points celeritascelery | 6 comments | | HN request time: 2.207s | source | bottom
Show context
josteink ◴[] No.44356722[source]
For those not into the lingo, Tramp is the Emacs module/package responsible for allowing you to transparently work on remote files and host in your local editor in a way I haven’t seen any other software do.

And yes, it’s really neat.

replies(3): >>44356916 #>>44356998 #>>44357028 #
1. geocar ◴[] No.44356998[source]
> in a way I haven’t seen any other software do.

It was novel once upon a time, but almost every internetworked operating system supports network-transparent files. Even my iPhone can do it.

Linux is a bit weird though: VIM has netrw which is very similar to Emacs; Gnome has a special VFS API that understands URIs, but only in the loosest possible sense of the word, and it can't work with autofs to "un-URI" something into a regular unix path, which is just sad.

But if you don't care about that, autofs can make it possible to cd /net/{hostname} and get my home directory over ssh on another machine, and works much better than tramp IMO, even under Emacs.

replies(2): >>44357181 #>>44357309 #
2. gray_-_wolf ◴[] No.44357181[source]
The thing is TRAMP also gives you a shell, not just a file access. When I am in a remote buffer, I can do M-x shell, and I will get a command line running on the remote host. What is more, since the T stands for Transparent, when I want to insert e.g. output of some command into a buffer, the command is executed on the remote host and I do not have to do anything special to achieve that, it just happens auto-magically based on the directory of current file (local vs. remote). I find that useful, and you cannot really do these things with a network drive on Windows.
3. skydhash ◴[] No.44357309[source]
It's not only about transparent access. It's about how the whole emacs ecosystem working with the files. So you can bookmark a remote file, and once accessed, you can launch dired (the file manager) for the file's directory, run the shell on the remote,... with the same binding and mechanism you have for local files. No need to alter configuration or launch a special windows for the project.
replies(2): >>44357649 #>>44357773 #
4. marai2 ◴[] No.44357649[source]
I’ve been using emacs for many years and I had no idea you can bookmark files let alone bookmark remote files! Thanks for educating me today!
replies(1): >>44359034 #
5. klik99 ◴[] No.44357773[source]
Exactly this, it's hard to explain to a non-emacs user why TRAMP is so magical, but the number of times I tried to run something that was meant to run locally on my machine through TRAMP and it just worked is very impressive. It runs so smoothly that you forget you're executing things on a remote machine, and when that leaks through it's typically very easy to diagnose and fix - for instance I have ag (silver searcher) installed on my local machine, tried running a search with ag via tramp and the bin obviously wasn't on the remote machine, a simple apt-get later and I could run my search with all my custom settings remotely.

If anyones ever used the Plan 9 OS across network, TRAMP is like that for emacs

6. skydhash ◴[] No.44359034{3}[source]
It's a neat feature. I typically bookmark directories on remote hosts, project roots, config files, etc,.. BTW, you can use `list-bookmarks` then annotate each bookmark with `e`, and display all the annotations with `A`.