I'm new to TextMate and thinking of using it for teaching purposes. I would like to fill out a form and have TextMate to automatically create the needed file. For instance I have a snippet called csc (short for CreateStandardClass) that looks like this
<br><br><div style="margin-left: 40px;">Class: ${1:ClassName}<br>SubClassOf: ${2:Object}<br>InstanceVariables: ${3:varName1},${4:varName2}<br></div><br>After I've entered the needed info (Rectangle, width and height) it looks like this
<br><br><div style="margin-left: 40px;">ClassName: Rectangle<br>SubClassOf: Object<br>InstanceVariables: width,height<br></div><br>After entering height and pressing tab I would like TextMate to generate the Objective-C code below. (It should be possible since all needed data is in the variables $1, $2, $3 and $4)
<br><br><div style="margin-left: 40px;">// Rectangle.h<br>#import <objc/Object.h><br>@interface Rectangle: Object<br>{<br> int width; <br> int height; <br>}<br>-(void) setWidth:(int) w;<br>-(void) setHeight:(int) h;
<br>-(int) width;<br>-(int) height;<br>@end<br><br><br>// Rectangle.m<br>#import "Rectangle.h"<br><br>@implementation Rectangle;<br>-(void) setWidth:(int) w<br>{<br> width=w;<br>}<br>-(void) setHeight:(int) h
<br>{<br> height=h;<br>}<br>-(int) width<br>{<br> return width;<br>}<br>-(int) height<br>{<br> return height;<br>}<br>@end<br></div><br><br>Is there a way to do this?<br><br>Thanks Bob<br>