<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>RubyGreenBlue::Blog textmate</title>
    <link>http://blog.rubygreenblue.com/</link>
    <pubDate>Sun Mar 09 19:59:11 +1100 2008</pubDate>
    <description>RubyGreenBlue::Blog</description>
    <item>
      <title>What Gedit Can and TextMate Can't</title>
      <link>http://blog.rubygreenblue.com/blog/article/what_gedit_can_and_textmate_cant</link>
      <description>&lt;p&gt;I noticed over at the &lt;a href="http://markgandolfo.com.au/"&gt;Mark Gandolfo&lt;/a&gt; blog, a post talking about &lt;a href="http://markgandolfo.com.au/articles/show/Ruby%20on%20Rails%20in%20Gedit"&gt;Ruby on Rails in Gedit&lt;/a&gt;. In his piece, Gandolfo claims &lt;/p&gt;

&lt;blockquote&gt;
    &lt;p&gt;I have to say, using textmate for nearly a month, I see things gedit can do that textmate can't! &lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;acck Phh!&lt;/p&gt;

&lt;p&gt;Now that's all well and good and I'm sure Gedit is a great tool, but I would love to know what Gedit can do that TextMate can't. Maybe I should ditch TextMate and switch to Gedit. Well... I'll wait to see what these super-dooper features are first.&lt;/p&gt;

&lt;p&gt;If Mr Gandolfo were to be so obliging as to post a list of things Gedit can do that TextMate can't, I'd happily address each point with either an explanation/example of how to do it in TextMate, or say "Ok, you got me on that one."&lt;/p&gt;</description>
      <pubDate>Sun Mar 09 19:59:11 +1100 2008</pubDate>
      <guid>http://blog.rubygreenblue.com/blog/article/what_gedit_can_and_textmate_cant</guid>
      <author>keith</author>
    </item>
    <item>
      <title>Remote Editing with TextMate</title>
      <link>http://blog.rubygreenblue.com/blog/article/remote_editing</link>
      <description>&lt;p&gt;TextMate does not have a save over sftp function, and I'm not sure &lt;a href="http://macromates.com/"&gt;Allan&lt;/a&gt; has any plans to add it in. Sometimes it's useful to edit files remotely. I often run my development server on another (faster) machine and do the actual editing on my trusty old (now slightly slow) PowerBook. &lt;/p&gt;

&lt;h2&gt;Solution&lt;/h2&gt;

&lt;p&gt;The solution is fairly rudimentary and simple but it works:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;create a TextMate project&lt;/strong&gt;. Create a &lt;em&gt;real&lt;/em&gt; TextMate project rather than temporary one as we will want to save some project variables. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;setup your project variables&lt;/strong&gt;. &lt;/p&gt;

&lt;p&gt;setup two project variables&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;$TM_REMOTE_SERVER&lt;/code&gt;. Set this to something like &lt;code&gt;keith@servername:&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;$TM_REMOTE_SERVER_PORT&lt;/code&gt;. Set this to 22 unless you have your ssh access setup over some other port&lt;/li&gt;
&lt;/ul&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;create a snippet&lt;/strong&gt; or better still, create a new bundle called something like "Remote Editing" and then a new snippet in that bundle. The snippet code:&lt;/p&gt;

&lt;p&gt;if [ "$TM&lt;em&gt;REMOTE&lt;/em&gt;SERVER" != "" ]
    then scp -P{$TM&lt;em&gt;REMOTE&lt;/em&gt;SERVER&lt;em&gt;PORT#22} -oStrictHostKeyChecking=no $TM&lt;/em&gt;FILEPATH $TM&lt;em&gt;REMOTE&lt;/em&gt;SERVER$TM_FILEPATH
  fi&lt;/p&gt;

&lt;p&gt;Have the snippet save the current file, output as a tooltip and set its key equivalent to &lt;code&gt;APPLE-s&lt;/code&gt;. It should all look something like this:&lt;/p&gt;

&lt;p&gt;&lt;a href="/blog/images/remote_save_snippet.jpg"&gt;&lt;img src="/blog/images/.remote_save_snippet_thumb.jpg" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;One limitation of this system is that the directory structure on both local and remote machines needs to be the same. It would be possible to address this issue, but mirroring my directory structures for projects I want edit remotely has not been a big deal for me. Basically you setup a /User/UserName/projects dir on each machine and everything is ok.&lt;/p&gt;

&lt;p&gt;You also need to have ssh public key authentication and an ssh-agent (like &lt;a href="http://mothersruin.com/software/SSHChain/"&gt;SSH Chain&lt;/a&gt;) running so that the scp happens without asking for a password.&lt;/p&gt;</description>
      <pubDate>Thu Dec 14 15:07:00 +1100 2006</pubDate>
      <guid>http://blog.rubygreenblue.com/blog/article/remote_editing</guid>
      <author>keith</author>
    </item>
  </channel>
</rss>
