<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xml:base="http://community.activestate.com" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
 <title>ActiveState Community Site - TextMate-style Snippets + Questions for the Komodo developers (UPDATE 2) - Comments</title>
 <link>http://community.activestate.com/forum-topic/better-textmate-style-macros-templates</link>
 <description>Comments for &quot;TextMate-style Snippets + Questions for the Komodo developers (UPDATE 2)&quot;</description>
 <language>en</language>
<item>
 <title>Could you please attach the</title>
 <link>http://community.activestate.com/forum-topic/better-textmate-style-macros-templates#comment-6474</link>
 <description>&lt;p&gt;Could you please attach the XML for this macro? It seems like a great script you&#039;ve made here but I can&#039;t try it out since your website seems to be down.&lt;/p&gt;
</description>
 <pubDate>Tue, 16 Sep 2008 06:17:37 -0700</pubDate>
 <dc:creator>Nathan</dc:creator>
 <guid isPermaLink="false">comment 6474 at http://community.activestate.com</guid>
</item>
<item>
 <title>Been a long time since I last posted in hereâ€¦</title>
 <link>http://community.activestate.com/forum-topic/better-textmate-style-macros-templates#comment-5982</link>
 <description>&lt;p&gt;@tdegrunt: Unfortunately nesting tabstops is not supported. I plan to include this support in future versions, however I canâ€™t commit to any dates as things are getting quite complicated and frankly I donâ€™t get much spare time :(&lt;/p&gt;
&lt;p&gt;@roamzero: I am aware there are some issues when using the Undo command. Unfortunately at this point the snippet engine does not monitor the state of the buffer. To get the snippets running again, hit TAB as many times as the number of tabstops youâ€™ve got in your latest snippet. Sorry.&lt;/p&gt;
&lt;p&gt;Cheers,&lt;br /&gt;
Stan&lt;/p&gt;
</description>
 <pubDate>Mon, 07 Jul 2008 02:24:02 -0700</pubDate>
 <dc:creator>Stan</dc:creator>
 <guid isPermaLink="false">comment 5982 at http://community.activestate.com</guid>
</item>
<item>
 <title>Undo problem.</title>
 <link>http://community.activestate.com/forum-topic/better-textmate-style-macros-templates#comment-5981</link>
 <description>&lt;p&gt;There is this weird issue where if you ctrl-z out of the snippet it caused the extension to stop working and act buggy for a bit before you can invoke it again. Is there a way to fix this?&lt;/p&gt;
</description>
 <pubDate>Mon, 07 Jul 2008 01:59:21 -0700</pubDate>
 <dc:creator>roamzero</dc:creator>
 <guid isPermaLink="false">comment 5981 at http://community.activestate.com</guid>
</item>
<item>
 <title>Complex snippets</title>
 <link>http://community.activestate.com/forum-topic/better-textmate-style-macros-templates#comment-5790</link>
 <description>&lt;p&gt;Is it possible to create more complex snippets like below, whereby there&#039;s nesting:&lt;/p&gt;
&lt;p&gt;&amp;lt;%= f.submit [[%tabstop:&quot;Submit&quot;]] [[%tabstop:, :disable_with =&amp;gt; &#039;[[%tabstop:Submitting]]&#039;]] %&amp;gt;&lt;/p&gt;
&lt;p&gt;This in analogy to TextMate&#039;s:&lt;br /&gt;
${TM_RAILS_TEMPLATE_START_RUBY_EXPR}f.submit &quot;${1:Submit}&quot;${2:, :disable_with =&amp;gt; &#039;${3:$1ing...}&#039;}${TM_RAILS_TEMPLATE_END_RUBY_EXPR}&lt;/p&gt;
&lt;p&gt;TextMate&#039;s even more complex, namely it&#039;ll replicate whatever you type at ${1:Sumbit} at ${3:$1ing...}.&lt;/p&gt;
</description>
 <pubDate>Wed, 25 Jun 2008 02:47:35 -0700</pubDate>
 <dc:creator>tdegrunt</dc:creator>
 <guid isPermaLink="false">comment 5790 at http://community.activestate.com</guid>
</item>
<item>
 <title>Hi Florent</title>
 <link>http://community.activestate.com/forum-topic/better-textmate-style-macros-templates#comment-5236</link>
 <description>&lt;p&gt;Sorry for my late reply, I have been quite busy at work recently. Yes, I intend to package this macro as an extension. I am currently reworking the macro; in fact I have started from scratch and I am building a very modular snippet engine.&lt;br /&gt;
Your post got me thinking. Itâ€™s really powerful to have a programming language behind the snippets. What I am currently trying to accomplish it to have a set of â€œtriggersâ€ that behave in the same manner, but are configured differently. So for example you can have your snippets in an XML file (called Container). You can also have a JavaScript file that would take a snippet such as this one â€œtable/head/body2x2/footâ€ and would output a 2x2 table with header and footer. Additionally you can have triggers that would work like GhostDoc for Visual Studio. Currently I am far away from having this feature in the engine, but the idea is to be able to have phpDoc and JDoc blocks auto-generated based on the signature of a method/function.&lt;/p&gt;
&lt;p&gt;I would be quite happy to have a look at your current work. Please send over any HTML/CSS snippets youâ€™ve got to insaned [ at ] abv [ dot ] bg.&lt;/p&gt;
</description>
 <pubDate>Tue, 29 Apr 2008 03:09:26 -0700</pubDate>
 <dc:creator>Stan</dc:creator>
 <guid isPermaLink="false">comment 5236 at http://community.activestate.com</guid>
</item>
<item>
 <title>Thank you Stan for this</title>
 <link>http://community.activestate.com/forum-topic/better-textmate-style-macros-templates#comment-5137</link>
 <description>&lt;p&gt;Thank you Stan for this answer.&lt;/p&gt;
&lt;p&gt;I will need some time to review both your macro and the built-in feature. Personally I quite like the way your macro works, It&#039;s powerful but doesn&#039;t feel bloated or hard to handle (speaking of the snippet file format... I&#039;m not a developer and I have limited knowledge of XML, but it&#039;s mostyly clear to me). It has great functionality, including the drop-down list that enables you to choose from various options and the way some snippets (such as the unordered list one in your example) behave.&lt;/p&gt;
&lt;p&gt;Do you intend to create a XPI extension once it&#039;s more polished?&lt;br /&gt;
For my private use, I would be glad with using your macro as it is right now. But my goal is to contribute a great HTML/CSS toolbox as well, so if it relies on an easy-to-install extension (or if it&#039;s included in it ;)), that&#039;s better. :)&lt;/p&gt;
&lt;p&gt;...&lt;/p&gt;
&lt;p&gt;Answering my question above: ok, you&#039;re already working on an extension. :)&lt;/p&gt;
&lt;p&gt;â€œI am also trying to compile a default snippets.xml that will support all standard HTML tags. Itâ€™s a lot of work, so as I said above, I will probably release all this in the next couple of weeks or so.â€&lt;/p&gt;
&lt;p&gt;Need help with that?&lt;/p&gt;
&lt;p&gt;If you have some time, check out the toolbox I shared (link in my previous post). It doesn&#039;t have all of the 91 standard HTML 4.01 tags, but it&#039;s a start. It also has some page templates that might be useful. Then it has some links to online ressources, and examples of code, that I don&#039;t intend to convert to Abbreviations or Snippets.&lt;/p&gt;
&lt;p&gt;By the way, I think you should consider (if you didn&#039;t already ;)) support of multiple Snippets files. What if you have your own Snippets file, and want to add snippets for a different language your learning, or combine your own snippets and some snippets shared by the whole team?&lt;/p&gt;
</description>
 <pubDate>Mon, 21 Apr 2008 06:45:34 -0700</pubDate>
 <dc:creator>Florent V.</dc:creator>
 <guid isPermaLink="false">comment 5137 at http://community.activestate.com</guid>
</item>
<item>
 <title>Hi Florent</title>
 <link>http://community.activestate.com/forum-topic/better-textmate-style-macros-templates#comment-5136</link>
 <description>&lt;p&gt;This is a great question and I would like to take the time to comment on it. If you are looking for a simple snippet triggering facility, then the Abbreviations feature introduced in 4.3 is pretty much all you need. Snippets are organised by language and you have a nice interface (the toolbox) to manage them.&lt;br /&gt;
If you are looking for more functionality then this extensions comes to the rescue. I donâ€™t want to repeat myself, but the list of planned features is pretty much listed in this thread so if you are interested I encourage you to have a look at the discussion above.&lt;/p&gt;
&lt;p&gt;So think about it, do you need more out of the facility already available in Komodo? Does it work for you? Do you need any of the features this extension provides? These questions should pretty much guide you in the right direction.&lt;/p&gt;
&lt;p&gt;Hope this helps.&lt;/p&gt;
</description>
 <pubDate>Mon, 21 Apr 2008 05:25:50 -0700</pubDate>
 <dc:creator>Stan</dc:creator>
 <guid isPermaLink="false">comment 5136 at http://community.activestate.com</guid>
</item>
<item>
 <title>Should I use this extension or built-in abbreviation feature?</title>
 <link>http://community.activestate.com/forum-topic/better-textmate-style-macros-templates#comment-5135</link>
 <description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;A few weeks ago I worked on &lt;a href=&quot;http://community.activestate.com/forum-topic/enhanced-html-css-toolbox&quot;&gt;a HTML+CSS snippet toolbox&lt;/a&gt; with sharing (and maybe inclusion in a future Komodo release, who knows?) in mind.&lt;/p&gt;
&lt;p&gt;So far it&#039;s still incomplete, but I&#039;m completing the set of HTML and CSS snippets. There are no keyboard shortcuts, so you have to activate snippets using the mouse (I know...). I used to have shortcuts, but providing a toolbox with like one hundred keyboard shortcuts that will inevitably clash with user preferences is not that sensible, so I just killed them.&lt;/p&gt;
&lt;p&gt;I thought that I would duplicate those snippets (and modify some of them) for use with the Abbreviations mechanism that was included in 3.3. But now I wonder if I should go with this extension instead.&lt;br /&gt;
Are there plans to enhance the Abbreviations feature using some of the improvements in this extension, or did the Komodo team decide to keep that feature simple and let people work with extensions for more advances functionality?&lt;/p&gt;
</description>
 <pubDate>Mon, 21 Apr 2008 04:24:21 -0700</pubDate>
 <dc:creator>Florent V.</dc:creator>
 <guid isPermaLink="false">comment 5135 at http://community.activestate.com</guid>
</item>
<item>
 <title>Thanks</title>
 <link>http://community.activestate.com/forum-topic/better-textmate-style-macros-templates#comment-5014</link>
 <description>&lt;p&gt;I&#039;ll be waiting for the new version then, in the meanwhile I&#039;ll be using the suggested.&lt;/p&gt;
&lt;p&gt;Thanks :)&lt;br /&gt;
--&lt;br /&gt;
Isaak Malik&lt;br /&gt;
Web Developer&lt;/p&gt;
</description>
 <pubDate>Fri, 11 Apr 2008 15:05:04 -0700</pubDate>
 <dc:creator>Isaak</dc:creator>
 <guid isPermaLink="false">comment 5014 at http://community.activestate.com</guid>
</item>
<item>
 <title>UI plus flexibility</title>
 <link>http://community.activestate.com/forum-topic/better-textmate-style-macros-templates#comment-4967</link>
 <description>&lt;p&gt;Yeah, pretty much we&#039;re in agreement. I guess the primary motivator for me is I&#039;ve tried both approaches (I&#039;ve lost count of how many snippet engines i&#039;ve built on top of editors, in an effort to &quot;textmate-ize&quot; them since before textmate even existed) and the &quot;language-based&quot; approach won hands down simply because XML doesn&#039;t really &quot;do&quot; anything by itself, eventually you have to resort to a language to process it, handle includes, handle interpolation, handle escapes, ... yadda yadda ... and before you know it you&#039;ve re-invented TemplateToolkit, which itself gets processed by a language. (jeez, how many &quot;middlemen&quot; are we inviting to this party?)&lt;/p&gt;
&lt;p&gt;I can see how some prefer XML though, I&#039;m just stating some of my rationale for being less favorable towards it, based on prior experiences.&lt;/p&gt;
&lt;p&gt;You are, however, absolutely spot-on with the part about UI. I don&#039;t know XUL well enough right now, else I&#039;d be helping with coding instead of just commenting, but it looks like you&#039;re on the right track.&lt;/p&gt;
&lt;p&gt;1) dont force me to memorize key combos&lt;br /&gt;
2) dont make me use the mouse to select snippets&lt;br /&gt;
3) DO allow me to choose from a list using a &quot;filter as you type&quot; interface&lt;br /&gt;
4) DO allow me to assign custom key combos for those instances were I *am* willing to memorize combos&lt;br /&gt;
5) DO allow me to easily jump into and out of any language regardless of filetype&lt;br /&gt;
6) DO allow me to get a lot of this done without having to take my fingers off the home row&lt;br /&gt;
7) DO allow me to easily manage snippets and translate them from different formats, so I can: i)import and export all the stuff I&#039;ve done from other editors; and ii) use or create a tool that allows me to &quot;convert&quot; into and out of work done by other communities (e.g., mass convert of Textmate bundles and my own python/perl/ruby stuff into and out of Komodo).&lt;/p&gt;
&lt;p&gt;This kind of thing is not easy to do (right) which is why I&#039;ve admired those few editors and IDE&#039;s that either &quot;get it&quot; ... or else are easily extensible enough to get out of the way and let you do it right yourself. So far I&#039;ve seen only one or two that even come close in windows-land.&lt;/p&gt;
&lt;p&gt;I&#039;m not sure where Komodo fits in that spectrum, but it does look somewhat promising. Work like what you&#039;ve done here seems to help push it that much further.&lt;/p&gt;
&lt;p&gt;====&lt;br /&gt;
UNRELATED: The only other apparent &quot;minus&quot; of Komodo (for me anyway) is it seems way too complicated to add custom syntax coloring for my own filetype. E.g., what if I want to add *very simple* syntax coloring on text files? Luddite looks nice, but there&#039;s gotta be an easier way to simply say &quot;make all non-alphanumerics a different color&quot;.&lt;/p&gt;
</description>
 <pubDate>Tue, 08 Apr 2008 10:35:38 -0700</pubDate>
 <dc:creator>dreftymac</dc:creator>
 <guid isPermaLink="false">comment 4967 at http://community.activestate.com</guid>
</item>
<item>
 <title>Hey again</title>
 <link>http://community.activestate.com/forum-topic/better-textmate-style-macros-templates#comment-4964</link>
 <description>&lt;p&gt;I love thinking in code, you are absolutely right, nothing speaks better.&lt;/p&gt;
&lt;p&gt;I donâ€™t really see the advantages of using Python, Ruby or any other programming language to store the snippets. Whether it is XML, text files or anything else itâ€™s just a container. Nothing stops you from writing layers on top of it, whether they would trigger functions from Python, provide additional parsing and act like plug-ins, etc. I think either way you just need a way to store the snippets. Itâ€™s more of a personal choice whether you would stuff snippets in XML and then write plug-ins on top of it to support various new tasks or you are going to rely on Python and whatâ€™s already available in Python to do the work. Personally I find XML better and easier. Itâ€™s widely used by everyone, even a junior web developer already knows how to write and read XML. It has a clear model of describing chunks of data and is extensible.&lt;/p&gt;
&lt;p&gt;Eric from Active State has also raised this issue in his post. At the end of the day nothing works better than a UI on top of, be it XML, Python/Ruby files, the toolbox or whatever. I think we all agree on this one.&lt;/p&gt;
&lt;p&gt;Looking forward to your comments,&lt;br /&gt;
Stan&lt;/p&gt;
</description>
 <pubDate>Tue, 08 Apr 2008 08:11:17 -0700</pubDate>
 <dc:creator>Stan</dc:creator>
 <guid isPermaLink="false">comment 4964 at http://community.activestate.com</guid>
</item>
<item>
 <title>clean snippet definition and manipulation</title>
 <link>http://community.activestate.com/forum-topic/better-textmate-style-macros-templates#comment-4963</link>
 <description>&lt;p&gt;I&#039;ll try to explain a bit more why I think XML is not the best choice for defining snippets. &lt;/p&gt;
&lt;p&gt;Nothing speaks like an example, so here is one to illustrate a bit of what I am talking about. Consider how readable this is compared to XML. Also notice that &quot;piggybacking&quot; on a full-fledged programming language allows us to do a bunch of custom things that cannot already be done with XML, and yet there&#039;s *nothing* that we can do in XML that we cannot do here.&lt;/p&gt;
&lt;pre&gt;
    ...

    ### begin: define pysnip_entry
        oEntry                = core_pysnip.snipentry()
        oEntry.sigil          =  &#039;___&#039;    ### the user can redefine the &#039;placeholder&#039; syntax
        oEntry.caption        =  &#039;new blank simpletable&#039;;
        oEntry.abbrev         =  &#039;simpletable&#039;;
        oEntry.desc           =  &quot;&quot;&quot;new simpletable for html or xml, with a secret message thrown in&quot;&quot;&quot;;
        oEntry.keycombo       =  None;
    ### ------------------------------------------
        oEntry.body =r&quot;&quot;&quot;
            {table}
                {tr}
                    {td}___cell1{/td}
                    {td}___cell2{/td}
                    {td}___cell3{/td}
                {/tr}
            {/table}

            {p}Secret message: ___{String.rot13(&#039;HelloWorld!&#039;)} {/p}
        &quot;&quot;&quot;
    ### ------------------------------------------

### begin_: do cool stuff with snippets
    mysnips = html.getsnips(abbrev.startswith(&#039;simple&#039;)); ## get more than one
    mysnip  = gui_chooserdialog(mysnips);  ## use a textmate-style chooser
    page    = html.getsnip(name.equals(&#039;newdoc&#039;)); ## outer enclosing page
    mysnip  = gui_fillintheblanks(mysnip); ## popup a gui dialog box auto-populated with every variable in our snippet
    page.body = mysnip.body;
    page.textarea_paste();

### begin_: do cool stuff with entire snippet libraries
    myexport = core_pysnip.export(libname.match(&#039;perl&#039;)).to_xml;
    n2export = core_pysnip.export(libname.match(&#039;*&#039;)).to_textmate_bundle;
    n3export = core_pysnip.export(libname.match(&#039;x&#039;)).to_yaml;
    core_pysnip.export(&#039;*&#039;).to_base64encoded().upload_to_website();

    ### NOTE: curly-braces were put in to keep Drupal happy.
    ### Normally we would just use whatever syntax we want
    ### with ZERO ugly syntax hacks or escapes.

    ### NOTE: we have a bunch of snippets that look just like this
    ### one, all defined using python syntax. But you could do it
    ### using ruby or perl quite easily also, as these languages are
    ### all best-of-breed as far as manipulating strings goes.

    ### NOTE: the user can extend this however she wants without &quot;breaking&quot; 
    ### the syntax, add a custom attribute, add custom functions, metadata
    ### whatever. There&#039;s no need to reverse engineer the snippet file
    ### format, or processing language because it&#039;s all just python.
    ...
&lt;/pre&gt;</description>
 <pubDate>Tue, 08 Apr 2008 07:50:33 -0700</pubDate>
 <dc:creator>dreftymac</dc:creator>
 <guid isPermaLink="false">comment 4963 at http://community.activestate.com</guid>
</item>
<item>
 <title>Hey there</title>
 <link>http://community.activestate.com/forum-topic/better-textmate-style-macros-templates#comment-4962</link>
 <description>&lt;p&gt;Nice to have some feedback on this, really appreciated. &lt;/p&gt;
&lt;p&gt;RE 1 and 1.5) The main reason I am doing this is to have a better tool that extends far beyond the default abbreviation implementation made available in Komodo 4.3 (which is more or less a port of Jeffâ€™s initial trigger macro). As you said, there are already a couple of implementations available in the community forum, but what I am trying to do is to have one â€œbetterâ€ that captures all the basics and provides many new features.&lt;/p&gt;
&lt;p&gt;RE 2) I am aware the snippets.xml file could grow and with each new addition it only gets harder and harder to maintain. But look at this from another angle â€“ having a single file that you could xcopy over to a server and have it shared among your colleagues and friends is better than dealing with updates or syncing multiple files.&lt;/p&gt;
&lt;p&gt;RE i) The snippets.xml file is just a representation of the snippets you would normally put in your toolbox. You still have the ability to use special variables, such as [[%date]] or any other already available in Komodo.&lt;br /&gt;
RE ii) I find the use of CDATA sections much easier than dealing with HTML entities. Also new users wonâ€™t have to worry about valid XML.&lt;br /&gt;
RE iii) Not sure I follow in this one, but if you look at the sample XML file here: &lt;a href=&quot;http://www.psp-webtech.co.uk/komodo/snippets.xml&quot; title=&quot;http://www.psp-webtech.co.uk/komodo/snippets.xml&quot;&gt;http://www.psp-webtech.co.uk/komodo/snippets.xml&lt;/a&gt; you will see the [[%include]] command used in a couple of places.&lt;br /&gt;
RE iv) See comments below on new improvements.&lt;br /&gt;
RE v) I am afraid I donâ€™t understand this one.&lt;/p&gt;
&lt;p&gt;You make some good points in your post. Looking back to my previous reply you will see I am trying to overcome some of the, letâ€™s call them, major downsides of this extension. I am working on an UI to allow you to edit your snippets, so no XML skills would be required.&lt;/p&gt;
&lt;p&gt;I appreciate your feedback and letâ€™s keep the discussion going : )&lt;/p&gt;
&lt;p&gt;Cheers,&lt;br /&gt;
Stan&lt;/p&gt;
</description>
 <pubDate>Tue, 08 Apr 2008 06:22:33 -0700</pubDate>
 <dc:creator>Stan</dc:creator>
 <guid isPermaLink="false">comment 4962 at http://community.activestate.com</guid>
</item>
<item>
 <title>some questions for stan or anyone else</title>
 <link>http://community.activestate.com/forum-topic/better-textmate-style-macros-templates#comment-4961</link>
 <description>&lt;p&gt;Just some preliminary questions:&lt;/p&gt;
&lt;p&gt;1) How is this line of development an improvement over the other &quot;TextMate&quot; like enhancements by others? (see for example &lt;a href=&quot;http://blogs.activestate.com/jeffg/2006/08/textmatestyle_m.html&quot; title=&quot;http://blogs.activestate.com/jeffg/2006/08/textmatestyle_m.html&quot;&gt;http://blogs.activestate.com/jeffg/2006/08/textmatestyle_m.html&lt;/a&gt;) it seems like there are multiple people doing slightly different versions of the same idea, anyone have a side-by-side comparison?&lt;/p&gt;
&lt;p&gt;1.5) This seems to be re-inventing stuff made available in the latest release of KomodoEdit. Is this by design or did you start building this before you knew about the latest feature enhancements?&lt;/p&gt;
&lt;p&gt;2) I&#039;ve noticed a lot of snippet engines using XML. This seems like an ok choice but after a while it gets *very* cumbersome in some areas. Have you considered packaging snippets in a full-fledged programming language syntax, (such as Python?) ... [see note]&lt;/p&gt;
&lt;p&gt;Thanks for any feedback on these.&lt;/p&gt;
&lt;p&gt;----&lt;br /&gt;
Note: I&#039;ve used this approach before and it has huge advantages:&lt;br /&gt;
i) automatic support for variable interpolation and advanced string manipulation;&lt;br /&gt;
ii) no need to use CDATA escapes to avoid syntax collisions (e.g., with python just use &quot;&quot;&quot; or &#039;&#039;&#039; or pep292 Templates or printf or ... you have *many* alternatives)&lt;br /&gt;
iii) automatic support for &quot;snippet transclusion&quot; (e.g., if you define each snippet as a function and each &quot;language library&quot; as a class, the language already includes built-in support for cross-referencing from one place to another, no need to re-invent this)&lt;br /&gt;
iv) no hassles with XML kludges such as escaping greater-than signs or un-nestable CDATA symbols and other ugly and inelegant stuff&lt;br /&gt;
v) you can design snippets to be as simple or as complex as you want, on the simple side you don&#039;t even have to know Python (or Ruby or Perl, or whatever native syntax you use)&lt;/p&gt;
</description>
 <pubDate>Tue, 08 Apr 2008 05:56:44 -0700</pubDate>
 <dc:creator>dreftymac</dc:creator>
 <guid isPermaLink="false">comment 4961 at http://community.activestate.com</guid>
</item>
<item>
 <title>Hey Isaak</title>
 <link>http://community.activestate.com/forum-topic/better-textmate-style-macros-templates#comment-4950</link>
 <description>&lt;p&gt;I have converted this macro to an extension and it supports negative values for SNIPPETS_HTTP_RELOAD_INTERVAL (i.e. do not check for updates). By default the extension will also install the snippets.xml file in your home directory and it wonâ€™t reload it unless you change it (thanks Eric for introducing me to the koFileNotification service). There are a couple of new features as well such as the ability to pass arguments to templates (e.g. type input.hidden to get a hidden input field or input.file to get a file upload control). I plan to release the extension in the next couple of weeks. I am also working on a XUL front-end that will allow you to edit the snippets in a way similar to the toolbox.&lt;br /&gt;
I have also completely replaced the TAB-keyboard handler. In my development/local version I also provide support for tabchoice handlers, i.e. you get a list of predefined values for each TAB-stop. I am also trying to compile a default snippets.xml that will support all standard HTML tags. Itâ€™s a lot of work, so as I said above, I will probably release all this in the next couple of weeks or so.&lt;/p&gt;
&lt;p&gt;Just a suggestion, go to the toolbox, locate the Snippets macro, right click and select â€œEdit Macroâ€. Set the value of SNIPPETS_HTTP_RELOAD_INTERVAL to 24 hours or so. This will disable the automatic update.&lt;/p&gt;
&lt;p&gt;Cheers,&lt;br /&gt;
Stan&lt;/p&gt;
</description>
 <pubDate>Sun, 06 Apr 2008 16:13:58 -0700</pubDate>
 <dc:creator>Stan</dc:creator>
 <guid isPermaLink="false">comment 4950 at http://community.activestate.com</guid>
</item>
<item>
 <title>TextMate-style Snippets + Questions for the Komodo developers (UPDATE 2)</title>
 <link>http://community.activestate.com/forum-topic/better-textmate-style-macros-templates</link>
 <description>&lt;p&gt;&lt;strong&gt;Please make sure to read all updates to this thread:&lt;br /&gt;
&lt;a href=&quot;#comment-4657&quot;&gt;UPDATE 1&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;#comment-4740&quot;&gt;UPDATE 2&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Demo is available here: &lt;a href=&quot;http://www.psp-webtech.co.uk/komodo/demo/sample.html&quot; title=&quot;http://www.psp-webtech.co.uk/komodo/demo/sample.html&quot;&gt;http://www.psp-webtech.co.uk/komodo/demo/sample.html&lt;/a&gt;&lt;br /&gt;
&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;Background Information&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;I have been using Komodo for some time now. I switched from Zend Studio in a hope for a faster and better editor. Komodo is fantastic and the JavaScript macros put a whole new meaning to the word â€œextensibleâ€. However I found I was missing one very important feature from Zend â€“ templates. Komodo has support for snippets, but triggering snippets from your toolbox is slow and too complicated. I would like to be able to hit TAB and have my template appear in the editor. I also didnâ€™t like the idea of organising all my snippets inside the toolbox. I would like to be able to edit my snippets in Notepad or any other editor. I also want to be able to provide much more complicated scenarios where for example I select some number inside of the editor, I hit TAB and a menu appears allowing me to select an action e.g. convert British pounds to US dollars.&lt;br /&gt;
Having all of the above in mind I started working on my own Textmate-style macros/templates.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;img src=&quot;http://www.psp-webtech.co.uk/komodo/demo/sample.png&quot; align=&quot;right&quot; hspace=&quot;10&quot; vspace=&quot;10&quot; alt=&quot;Screen grab&quot; /&gt;A Better Engine&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;After spending two nights working on this engine, I am finally satisfied with the end result.&lt;br /&gt;
This JavaScript macro allows you to organise your snippets in a simple XML file which you upload on a website or on your localhost. The idea behind this is to be able to have the snippets shared across your team or between your work and home PC.&lt;br /&gt;
Each snippet can aggregate other snippets. For example you can combine your HEAD and BODY snippets to form the HTML snippet.&lt;br /&gt;
This engine also supports tab stops. When you reach the last tab stop in a given snippet and you hit TAB again the editor caret is moved back into position.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;What else is there/to come?&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;+ Snippets based on the file type, CSS, HTML&lt;br /&gt;
+ Display a menu when more than one snippet is found i.e. doctype&lt;br /&gt;
+ Chained snippets â€“ type ul inside an HTML document, hit TAB to expand the snippet, hit TAB again to insert a new list item&lt;br /&gt;
+ Support for local files was added. No need to put the snippets on a web server&lt;/p&gt;
&lt;p&gt;At this point not much else is provided by the engine. The snippets are handled by Komodo so you get all the usual stuff. Here is a list of things I am considering for the next big update of the engine:&lt;br /&gt;
- Placeholders i.e. &amp;lt;h1 id=&quot;page-title&quot;&amp;gt;Page Title&amp;lt;/h1&amp;gt;&lt;br /&gt;
- Auto-update engine&lt;br /&gt;
- Facility to execute remote URLs i.e. send active selection to a L10N table inside the DB and return the key back&lt;br /&gt;
- Dynamic snippets i.e. select a number within the editor and do [[%convert: GBP -&amp;gt;EUR]]&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Enough information already, I want the macro&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;For those of you that made it through to here, I am attaching the engine as a KPZ file. To install follow these steps:&lt;br /&gt;
- Fire up Komodo and go to Toolbox -&amp;gt; Import Packageâ€¦&lt;br /&gt;
- Locate the KPZ file on your computer and select Open&lt;br /&gt;
- Open your Toolbox panel (View -&amp;gt; Tabs -&amp;gt; Toolbox) and locate the Snippets entry in the list&lt;br /&gt;
- Right click and select Edit Macro&lt;br /&gt;
- Note the SNIPPET_URL at the top, make sure this is updated to point to a valid address where the snippets XML file is located at (a sample file is available here: &lt;a href=&quot;http://www.psp-webtech.co.uk/komodo/snippets.xml&quot; title=&quot;http://www.psp-webtech.co.uk/komodo/snippets.xml&quot;&gt;http://www.psp-webtech.co.uk/komodo/snippets.xml&lt;/a&gt;)&lt;br /&gt;
Close Komodo down and fire it up again. Open a new PHP file, type htmlpage and hit TAB. If everything installed properly, you should have an HTML skeleton page appear in your editor.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;How to create new snippets&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Please refer to the sample XML file here:&lt;br /&gt;
&lt;a href=&quot;http://www.psp-webtech.co.uk/komodo/snippets.xml&quot; title=&quot;http://www.psp-webtech.co.uk/komodo/snippets.xml&quot;&gt;http://www.psp-webtech.co.uk/komodo/snippets.xml&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Ideas, comments ?&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;I would really like to get your opinion on the engine â€“ does it work for you, what else you need, how flexible/fast you find it to be, etc. Any feedback would be much appreciated as I hope I will continue to spend time on this project.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Enjoy!&lt;/strong&gt;&lt;/p&gt;
</description>
 <comments>http://community.activestate.com/forum-topic/better-textmate-style-macros-templates#comments</comments>
 <category domain="http://community.activestate.com/forums/komodo-extensions-0">Komodo Macros and Extensions</category>
 <category domain="http://community.activestate.com/os/windows-xp-pro">Windows XP Pro</category>
 <enclosure url="http://community.activestate.com/files/Snippets.kpz" length="17851" type="application/octet-stream" />
 <pubDate>Fri, 14 Mar 2008 18:15:16 -0700</pubDate>
 <dc:creator>Stan</dc:creator>
 <guid isPermaLink="false">2076 at http://community.activestate.com</guid>
</item>
</channel>
</rss>
