New tool: smate - textmate editing over ssh

Matts on 2007-06-29T21:18:43

Get it here. And put it in /usr/bin and chmod a+x it.

Then just type: smate host:path/to/file and when you're done editing close the Textmate window and it'll save it back to the remote server.

I might add support at some point to monitor changes with IO::KQueue and send back to the server if it is saved. Let me know if that would be useful.

Uses rsync as the protocol to reduce bandwidth. Should support wildcards and/or directories but I haven't tested that yet.

Let me know if you find it useful.

Update: I've hacked it to use IO::KQueue now so it'll save every time you save the file. Much safer. You'll need IO::KQueue 0.32 which I just uploaded to CPAN as I found a bug in 0.31 which made it not work at all.


Cool

sigzero on 2007-06-30T13:16:23

I don't use Textmate....yet. But very cool...

A related solution

grantm on 2007-07-01T22:41:46

I attacked the same problem from a slightly different angle. Assuming I'm already logged in to 'remotehost' via ssh, I want to be able to type:

vi somefile

and have the 'right thing' happen automatically. In my case, the right thing is for a message to be sent back to my workstation which responds by opening a GUI editor window using this command:

gvim scp://remotehost//path/to/somefile

I used SSH port forwarding to supply the back channel for sending the messages and named the result bcvi - back-channel vi.

Like it

draegtun on 2007-07-02T08:53:14

I use Fugu to navigate over SSH. There's an edit button which loads selected remote file into local text editor (and saving the file puts it automatically back).

I use TextMate with above and it works like a dream (I believe CyberDuck also as this edit option). Longer term I think MacFuse looks the way to go.

I can also see smate becoming very useful tool to have available.

/I3az/

nifty

jmason on 2007-07-02T10:50:54

BTW, do you have EDITOR=mate in your environment? because you could make it editor-agnostic by just exec'ing $ENV{EDITOR} instead of "mate", which I for one would enjoy ;)

This is awesome. I like the "bcvi" hack, too; it'd be great if they could merge magically somehow.

Re:nifty

Matts on 2007-07-02T14:01:51

Yeah, the editor needs a foreground mode and you'd need to know the flags for that, that's the only potential problem.