Open local text application to edit remote text file using ssh?

never_had_a_name picture never_had_a_name · Sep 13, 2010 · Viewed 11.3k times · Source

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.

Answer

furtive picture furtive · Sep 29, 2010

The solution is to mount the remote system using sshfs. On OS X, sshfs can for instance be installed by using Homebrew.

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.