I've just started to try out TextMate :). I've created a little snippet called vam (short for variable and method) that looks like this
{ int ${1:var}; }
-(void) set${1:var}:(int) n;
So when I enter vam and hit tab, I am presented with the following chunk
{ int var; }
-(void) setvar:(int) n;
where var is highlighted. If I start to type numerator the chunk changes to
{ int numerator; }
-(void) setnumerator:(int) n;
However I would like setnumerator to be outputted as setNumerator.
Is there a way to do this?
Thanks Bob
Bob Ueland asked:
However I would like setnumerator to be outputted as setNumerator.
Is there a way to do this?
Sure: you just need to use a transformation in the replacement: something like
{ int ${1:var}; }
-(void) set${1/(\w+)/\u$1/}:(int) n;
should do the trick. See section 7.7 of the TextMate manual.
Cheers, Paul