edit files remotely: emacs + tramp

Mac OS X

Vinh Nguyen


June 2, 2009

Suppose I want to edit a file remotely. I don't want to download/ftp the file to my computer, edit, and send it back to the remote server. In emacs, I can edit it remotely using tramp via the ssh or rcp protocol. Put following in the .emacs file after installing tramp.

;; tramp stuff
;; http://ubuntuforums.org/showthread.php?t=760038
(require 'tramp)
(setq tramp-default-method "ssh")

Read a remote file by C-x C-f /user@your.host.com:/path/to/file. Note we Need that '/' before username. This is a good reference for tramp.