I'm setting up a remote editing capability through Tramp from my Mac OS X laptop to an Ubuntu box, and have defined the following:
(setq tramp-default-user "myusername" tramp-default-host "myhostname") (setq tramp-default-method "ssh") ;;Open a file on my linux box (defun remote-find-file (file-name) "Like find file, but opens the file on my box" (interactive "FRemote Find File: ") (let ((tramp-file-name (expand-file-name file-name))) (find-file tramp-file-name))) (global-set-key (kbd "C-x C-u") 'remote-find-file)
The issue I have is that
expand-file-name is expanded using the Mac OS X conventions, so that
~ turns into
/Users/myusername instead of
/home/myusername. I suspect there's a way to fix this using file name completion, but I can't figure it out from the Tramp documentation.