[TxMt] Re: Using mate command with templates (Combining Templates and Snippets)

Hans-Jörg Bibiko bibiko at eva.mpg.de
Fri Jan 16 19:49:54 UTC 2009


A next step would be to use that approach to combine TM's Template and  
Snippet technology (the easy way):

E.g. an HTML template:
- create a normal template
- content:
mate "$HOME/untitled.html"
osascript -e "tell app \"TextMate\" to insert \"`cat index.html | perl  
-pe 's/\"/\\\\\"/g'`\" as snippet true"


- add a new template file
- content:
<html>
<body>

Hello, I'm a "template"

Date:         `date +%Y-%m-%d`
Name:         ${1:$TM_FULLNAME}
Organisation: $TM_ORGANIZATION_NAME

Title: ${2:Write here your title}

Text:  ${3:Write here your text}

${0:}
</body>
</html>

here the template:

-------------- next part --------------
A non-text attachment was scrubbed...
Name: HTML_TEST_TEMPLATE.tmTemplate.zip
Type: application/zip
Size: 1166 bytes
Desc: not available
URL: <http://lists.macromates.com/textmate/attachments/20090116/c442430a/attachment.zip>
-------------- next part --------------



--Hans


More information about the textmate mailing list