Hot answers tagged

18 votes
Accepted

Tramp mode is much slower than using terminal to ssh

Turns out it was projectile that was causing the problems. As soon as I disabled projectile-mode TRAMP was buttery smooth and I began to understand the hype behind it. Hopefully this helps out ...
user avatar
  • 683
15 votes
Accepted

Use sudo while editing over SSH?

Using TRAMP multi-hops. For instance, if you want to edit the remote file /root/salary.txt /ssh:homer@powerplant|sudo:powerplant:/root/salary.txt The example is taken from the Mastering Emacs book.
user avatar
12 votes
Accepted

Using Tramp for logs

auto-revert-tail-mode is great, but it has its limits. Therefore I prefer to use an asynchronous shell command. Open the remote directory in dired, position the cursor to the file you want to watch, ...
user avatar
11 votes
Accepted

Magit equivalent of 'git remote add origin git@github.com:user/project.git'?

The equivalent of the git command in Magit is to set a new Remote. This is where it is in the docs Ma creates a new remote. When asked for the name of your remote, the usual answer is the name of ...
user avatar
  • 695
10 votes

Tramp mode is much slower than using terminal to ssh

I have also found the solutions on the tramp FAQ that address speeding tramp up to work pretty well. From the page, here is what I added to my configuration: (setq remote-file-name-inhibit-cache nil)...
user avatar
7 votes
Accepted

Fetch configuration from remote (e.g. Github) at startup

I would do this outside of Emacs, with a wrapper script that pulls the updated config first. Something like this: #! /bin/sh cd ~/.emacs.d && git pull --rebase exec /usr/bin/emacs "$@" Then ...
user avatar
  • 161
5 votes
Accepted

Efficiently call remote processes

What about writing a "safe" version of shell-command that would properly escape arguments using shell-quote-argument ? For example: (defun safe-shell-command (args &optional output-buffer error-...
user avatar
  • 4,440
5 votes
Accepted

How can I use Emacs in a SSH sever that I logged in through emacs terminal?

There is Tramp. You can edit a file on another machine using the syntax /ssh:user@machine:/path/to/file. If you take sudo instead of ssh, and empty user and machine, you can edit a local file as root. ...
user avatar
5 votes

Fix compilation mode paths when compiling in container or remotely

If I understand your question correctly, the simplest solution that I have found is to set the variable directory-abbrev-alist to map directories in the compilation buffer to the host system. For ...
user avatar
  • 53
3 votes

Use sudo while editing over SSH?

I wrote a command for automating @Manuel Uberti's answer. The second one is the one I'd use. It uses the first one for remote files and uses crux for local files. (require 'crux) (require 's) (defun ...
user avatar
3 votes
Accepted

How to rsync/fetch/download the folder open with ssh/tramp

Make sure that dired-dwim-target is set to t, split the frame in two windows, open a local directory in the other window with dired where you want the copy to land, mark the file that you want to ...
user avatar
  • 20.4k
3 votes
Accepted

Directory tracking in remote shell buffer

Not the best solution, but certainly a working one: Use [dirtrack-mode]. The following preparations are needed: 1. On the remote machine: Make sure the prompt of the remote shell contains the path ...
user avatar
  • 1,081
3 votes

Identify remote directories and open files through tramp from emacs terminal

Tramp works on the basis of default-directory. If you run a shell in Emacs, and you perform ssh in that shell, the buffers's default-directory is still the local path the shell was started from. You ...
user avatar
3 votes

How do I use a remote virtual environment with emacs?

No, You can't use a remote virtual environment with emacs with elpy as of now. Here is jorgenschaefer the author of elpy) comments on this I'm afraid that won't work. Tramp does a lot of magic with ...
user avatar
3 votes
Accepted

Which package to share editing, in real-time, over http?

You might be thinking about impatient-mode, which is available in MELPA, and also on GitHub. I haven't tried it myself, but according to Sacha Chua's blog post about it it seems to be easy to use: ...
user avatar
  • 5,864
3 votes

Python remote debugging?

You can try qdb https://github.com/quantopian/qdb An emacs interface (qbd.el) is included: https://github.com/quantopian/qdb/tree/master/client/emacs
user avatar
  • 3,056
3 votes
Accepted

Dired+ doesn’t work on old remote system

And not to forget the hint in the Tramp manual: Emacs computes the ‘dired’ options based on the local host but if the remote host cannot understand the same ls command, then set them with a hook as ...
user avatar
3 votes

Tramp ignores remote paths, no matter what

call-process runs local processes. For remote processes, you must use process-file instead.
user avatar
2 votes
Accepted

Attach to running remote shell with eshell/TRAMP/dtach

Maybe not satisfactorily, but this issue is on the Tramp wish list. Maybe it will be implemented some day. See the discussion on the Emacs Devel ML http://thread.gmane.org/gmane.emacs.devel/174131
user avatar
2 votes
Accepted

dired: is file under point local or remote?

If you simply want to know whether the file is accessed through a remote acces method, you can call file-remote-p (built into Emacs) or Tramp's similar function tramp-handle-file-remote-p. Both ...
user avatar
2 votes

dired: is file under point local or remote?

I realize you're asking to detect tramp buffers vs, say, files on a remote mounted filesystem, but for posterity this might be useful to other searchers: (defun buffer-is-on-local-fs-p () (and (...
user avatar
  • 190
2 votes

How can I access a file at an (HTTP / HTTPS) URL?

,----[ C-h f url-handler-mode RET ] | url-handler-mode is an interactive autoloaded compiled Lisp function | in `url-handlers.el'. | | (url-handler-mode &optional ARG) | | Toggle using `url' ...
user avatar
  • 3,276
2 votes

How can I access a file at an (HTTP / HTTPS) URL?

M-x browse-url-emacs RET URL RET
user avatar
  • 43.8k
2 votes

Fetch configuration from remote (e.g. Github) at startup

Since I presume you are going to be sshing to these machines, I suggest you can take a look at sshrc which lets you take your local dotfiles along when you ssh into any server.
user avatar
  • 121
2 votes
Accepted

TRAMP doesn't know some of the remote commands

Your $PATH settings in your init file are not taken into account per default. Try the following: (add-to-list 'tramp-remote-path 'tramp-own-remote-path) See also the Tramp manual discussing this ...
user avatar
2 votes
Accepted

Tramp FTP cant connect. tramp-file-name-handler: Host name must not match method "ftp"

Your syntax is wrong, it misses the trailing colon. Try C-x C-f /ftp:username@subdomain.hostname.com:
user avatar
2 votes

Remote machine: Your terminal lacks the ability to clear the screen or position the cursor

Use M-x term instead of M-x shell. shell isn't a terminal emulator, term is. Also a hint: term-mode has two submodes, line-mode and char-mode. You can switch between them with C-c C-k and C-c C-j. ...
user avatar
  • 478
2 votes

How to eliminate excessive filesystem accesses that are slow over sshfs?

If you don't need version control, disable it. (setq vc-handled-backends nil)
user avatar
2 votes

How to eliminate excessive filesystem accesses that are slow over sshfs?

Perhaps use Tramp instead of sshfs. The latter can't be recognized as easily as a slow file system as it is implied by the former.
user avatar
  • 1,051

Only top scored, non community-wiki answers of a minimum length are eligible