Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

Matts (1087)

Matts
  (email not shown publicly)

I work for MessageLabs [messagelabs.com] in Toronto, ON, Canada. I write spam filters, MTA software, high performance network software, string matching algorithms, and other cool stuff mostly in Perl and C.

Journal of Matts (1087)

Friday June 29, 2007
04:18 PM

New tool: smate - textmate editing over ssh

[ #33642 ]

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.

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • I don't use Textmate....yet. But very cool...
  • 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-ch [perlmonks.org]

  • 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/
  • 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.
    • Yeah, the editor needs a foreground mode and you'd need to know the flags for that, that's the only potential problem.