<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><title type="text">WeirdLooking.com: Michael Barton's Blog</title><rights>Copyright 2006</rights><author><name>Michael Barton</name><email>palrich@gmail.com</email></author><updated>2010-09-07T15:01:16Z</updated><generator>WeirdLooking.com</generator><logo>http://www.weirdlooking.com/images/feed.png</logo><link rel="alternate" type="text/html" href="http://www.weirdlooking.com/" /><link rel="self" type="application/xml+atom" href="http://www.weirdlooking.com/atom/tag/abbreviations" /><id>http://www.weirdlooking.com/</id><entry><title type="text">Abbreviation expansion in Komodo Edit</title><author><name>Michael Barton</name></author><link rel="alternate" type="text/html" href="http://www.weirdlooking.com/blog/abbreviation-expansion-in-komodo-edit" /><id>http://www.weirdlooking.com/blog/abbreviation-expansion-in-komodo-edit</id><published>2007-11-11T19:06:06Z</published><updated>2007-11-11T19:06:06Z</updated><content type="html">So, I&amp;rsquo;ve been pretty jealous of TextMate lately.&amp;nbsp; I really can&amp;rsquo;t see spending $2,000 for a text editor (including the Mac), though.&amp;nbsp; This morning, I hacked up an &lt;a href=&quot;http://www.weirdlooking.com/blog/92/abbr.kpf&quot; style=&quot;position: relative; padding-left: 8px; zoom: 1;&quot;&gt;&lt;span style=&quot;position: absolute; top: -5px; left: 0px; width: 16px; height: 16px; background: URL(http://www.weirdlooking.com/exticon?http%3A%2F%2Fwww.weirdlooking.com%2Fblog%2F92%2Fabbr.kpf) no-repeat center center; -moz-opacity: 0.3; opacity: 0.3; filter:alpha(opacity=30);&quot;&gt;&lt;/span&gt;attempt&lt;/a&gt; at TextMate-style abbreviation expansion in Komodo Edit, using a javascript macro.&lt;br /&gt;&lt;br /&gt;Unlike &lt;a href=&quot;http://community.activestate.com/forum-topic/trigger-now-tabstop-support&quot; style=&quot;position: relative; padding-left: 8px; zoom: 1;&quot;&gt;&lt;span style=&quot;position: absolute; top: -5px; left: 0px; width: 16px; height: 16px; background: URL(http://www.weirdlooking.com/exticon?http%3A%2F%2Fcommunity.activestate.com%2Fforum-topic%2Ftrigger-now-tabstop-support) no-repeat center center; -moz-opacity: 0.3; opacity: 0.3; filter:alpha(opacity=30);&quot;&gt;&lt;/span&gt;other versions&lt;/a&gt; I&amp;rsquo;ve found, it doesn&amp;rsquo;t rely on the editor&amp;rsquo;s built-in word selection.&amp;nbsp; Instead, it grabs the text of the current line up to the cursor position and runs it through a regular expression.&amp;nbsp; There are several consequences to this:&amp;nbsp; It can be assigned to the tab key, since the regex eats whitespace.&amp;nbsp; I was also able to add generic HTML tag expansion, so that &amp;ldquo;&amp;lt;h1[TAB]&amp;rdquo; expands to &amp;ldquo;&amp;lt;h1&amp;gt;&amp;lt;/h1&amp;gt;&amp;rdquo;, with the cursor set between them.&amp;nbsp; I&amp;rsquo;m not sure if TextMate does this, but it probably should.&lt;br /&gt;&lt;br /&gt;It also makes use of subfolders for different programming languages.&amp;nbsp; If two subfolders contain snippets with the same name, it&amp;rsquo;ll preferentially select the subfolder with the same name as the language of the current document.&lt;br /&gt;&lt;br /&gt;TextMate can do some cool stuff Komodo can&amp;rsquo;t, like intelligently tabbing through different parts of a snippet that need customization.&amp;nbsp; I can&amp;rsquo;t see any way to do that in Komodo without making it a terrible hack (like inserting &amp;ldquo;TODO&amp;rdquo; wherever focus is needed, then tabbing to the next &amp;ldquo;TODO&amp;rdquo;).&lt;br /&gt;&lt;br /&gt;Anyway, I&amp;rsquo;m fairly happy with it as is.&amp;nbsp; Now I just need to figure out how to generate code intelligence settings for our codebase at work.</content><category term="komodo" /><category term="abbreviations" /><category term="textmate" /><link rel="comments" type="application/atom+xml" href="http://www.weirdlooking.com/atom/comments/92" /><wfw:commentRss>http://www.weirdlooking.com/atom/comments/92</wfw:commentRss><slash:comments>0</slash:comments></entry></feed>