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.
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.
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.