tags:

views:

133

answers:

5

So i am in a VPS terminal using ssh.

In normal case I could just run locally

mate <file>

and it fires up TextMate with that file.

Is it possible to use the same command and somehow open the local TextMate application but editing the remote file?

That would be good if you are working in VPS and don't want to use vim all the time.

+1  A: 

If you do ssh to another box then you can open the file using cat and pipe it to a local file. I dont think so that you can stream it to an editor in the local box.

Raghuram
There has to be some tools that allows that .. sounds like a feature someone has thought about long before me.
never_had_a_name
If its there it will be highly helpful to me also...
Raghuram
+1  A: 

The solution is to mount the remote system using SSHFS, on OSX the best option for this is MacFUSE.

The filesystem is mounted via SSH using your regular SSH credentials or key so it's very easy to do, and then you navigate it as if it's a local directory and enjoy the benefit of having access to all your local tools.

furtive
SSHFS is fun until the connection to the server drops. Then you have to SIGKILL everything in sight. IDK maybe I'm just using an old version.
Michael Kropat
I can't vouch for SSHFS specifically but using MacFUSE if I lose my connection the drives unmount cleanly, and I've had sites mounted for days at a time. YMMV.
furtive
Have had the same problems Michael describes, not even a reconnect setting helped. For all the uses sshfs has, the moments I could employ it usually ended up with either cron- or manual rsyncs over ssh.
Wrikken
+1  A: 

Alternatively you could sync the folder with rsync over ssh.

That way you work locally, and let rsync sync it to the server for you. That could either be explicitly initiated by you or be run in a daemon.

eglasius
+2  A: 

You have different options:

  • mounting a remote filesystem using (Mac)Fuse (as recommended by furtive),
  • synchronize a your remote directory with rsync (as recommended by eglasius),
  • or, and this would be my preferred way, use Emacs (Aquamacs, I guess, in your case) and use the tramp mode to edit remote files.

I used to do this in 2006 and 2007 for some projects, and it worked perfectly.

If you want to stick to TextMate, then furtive's solution is ideal.

haylem