Mirrors in interpolated shell code in snippets

View: New views
3 Messages — Rating Filter:   Alert me  

Mirrors in interpolated shell code in snippets

by bhawkeslewis :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

For when a single regular expression is not sufficient for a mirror
transformation, is there any way to access current mirror values from
within interpolated shell code in snippets?

(I'm trying to write a transformation that will first convert a human
phrase to CamelCase /then/ lowercase the first character to generate a
StudlyCaps version of the phrase.)

--
Benjamin Hawkes-Lewis

_______________________________________________
textmate mailing list
textmate@...
http://lists.macromates.com/listinfo/textmate

Re: Mirrors in interpolated shell code in snippets

by bhawkeslewis :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On 2/7/09 14:57, Benjamin Hawkes-Lewis wrote:
> (I'm trying to write a transformation that will first convert a human
> phrase to CamelCase /then/ lowercase the first character to generate a
> StudlyCaps version of the phrase.)

As a sidenote, I've found I can do this with conditional inserts:

${1/^(\w)(\w*)|\W*(\w)(\w*)\W*/(?1:\l$1$2)\u$3$4/g}

--
Benjamin Hawkes-Lewis

_______________________________________________
textmate mailing list
textmate@...
http://lists.macromates.com/listinfo/textmate

Re: Mirrors in interpolated shell code in snippets

by Allan Odgaard-4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On 2 Jul 2009, at 15:57, Benjamin Hawkes-Lewis wrote:

> For when a single regular expression is not sufficient for a mirror
> transformation, is there any way to access current mirror values from
> within interpolated shell code in snippets?

There is not, no — it’s difficult enough keeping track of all the  
mirror cascading without running arbitrary code during typing ;)


_______________________________________________
textmate mailing list
textmate@...
http://lists.macromates.com/listinfo/textmate