tags:

views:

274

answers:

3

Is it possible to edit files on a remote machine using the MATE command to work on a project / directory locally?

+2  A: 

If you have FTP/SFTP access to the machine use Transmit to access that machine.

In Transmit's "Files" preferences pane set TextMate as the default "Custom File Editor".

Use Transmit's file browser to find the file you want then you can use the "Edit in Textmate" from the right click menu or from File->Edit with External Editor (Command-J). Now when you save in Textmate it will send the saved file to the remote machine.

I believe that other FTP clients have the same or similar functionality, but Transmit is only $30.

Good Luck.

Mark Thalman
Just a warning: I used to do something similar with a Samba mount and it used to hang on save quite a bit. This is one of the reasons why I started learning `vim` and ended up switching over.
Benjamin Oakes
I've been doing this for years and have never had a problem, even back in the days of modems and DSL, but it is in memory if the save fails, do a "Save As..." in TM, reconnect to the server, and upload the file the traditional way.
Mark Thalman
Benjamin, There is an old quote "vi has two modes. One in which it beeps and one in which it doesn't." Personally I prefer pico or emacs, although EMACS has a very steep learning curve.
Mark Thalman
+1  A: 

In addition to @Mark's suggestion, you can use Cyberduck instead of Transmit.

It's free and allows remote files to be edited using TextMate.

Gareth Davis
I tried CyberDuck for a couple of months. I found it slow and buggy. It kept dropping connections and the files that were transferred weren't always correct. With the FTP programs I have paid for (Fetch, Interarchy, and Transmit, in chronological order) I have never had an incorrect file or a dropped connection, it pretty much comes down to interface and price and, IMHO, Transmit wins on both counts.
Mark Thalman
Been using Cyberduck for the last couple of months for SCP and S3 connections, haven't had a problem yet.
Gareth Davis
Cyberduck works perfectly
Derek Organ
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 environment's resources.

furtive