I'm evaluating TextMate, trying to figure out if I can make the switch from BBEdit. It looks very much like Linux -- very powerful, but having a devil of a time getting work done as I make the switch. So please forgive me as I pepper you with questions. I'm going to try to put them in separate emails to split them up into threads.
OK, I'm making a new template for my SHTML files. My first question: how do I make the tab stops work properly?
When I use the following template, the cursor (er, caret in TM parlance) is at the *start* of the document, and tabbing doesn't move me to the other positions. I find this odd b/c I thought that the caret position was supposed to default to the end. Anyway, the tab stops aren't working at all, so I must be making some mistake. I just can't find it.
The variables for selected text and date *do* work.
help, please? CC
<!--#set var="pagetitle" value=""${2:Untitled}"" --> <!--#set var="page_type" value="class=\"page_article\"" -->
<!--#include virtual="/inc/wrappers/news_releases_top.inc"-->
<!-- BEGIN CONTENT -->
<h3></h3>
${1}${TM_SELECTED_TEXT}
<p class="article_data pub_date">${TM_DATE}</p>
<!-- END CONTENT -->
<!--#include virtual="/inc/wrappers/news_releases_btm.inc"-->
Hi,
OK, I'm making a new template for my SHTML files. My first question: how do I make the tab stops work properly?
When I use the following template, [...] . Anyway, the tab stops aren't working at all, so I must be making some mistake. I just can't find it.
The variables for selected text and date *do* work.
don't mix up templates and snippets. Only if one inserts it as "Insert as Snippet" the TABs are working, a template inserts everything only as plain text.
But Hendrik Nyh found a nice solution: a "Snipplate" bundle http://henrik.nyh.se/2007/02/snippet-power-templates-in-textmate
Install that bundles http://henrik.nyh.se/uploads/Snipplate.tmbundle.zip
and open it with the bundle editor to modify/copy/... it.
An other approach is to provide a NIB dialog for entering initial data. This is useful for complex templates.
Cheers,
--Hans