here's my attempt. just double click the bundle to install. should convert all characters to lowercase then add underscores instead of spaces. I don't know why it's inserting the newline though. if someone knows how to use sed they could make a better command.

hope this helps!

-Nick

On Wed, Nov 19, 2008 at 10:43 AM, Hans-Jörg Bibiko <bibiko@eva.mpg.de> wrote:

On 19.11.2008, at 19:25, Michael Reiner wrote:

> Can anyone help with a command that would convert the case of selected
> text as well as replaced spaces with underscores?
>
> So, for instance:
>
> This is a Title  ->  this_is_a_title
>
> As a complete beginner in TextMate, I'm not sure how to create a
> command to do this.

There're many ways. Maybe the simplest - record a macro:

- type 'This is a Title' and select it

- Bundles > Macro > Start Recording

- Text > Convert > to Lowercase

- Edit > Find > Find [APPLE+F]

– Find: ' ' (a space)
  Replace: '_'

  Hold down OPTION key and execute 'In Selection'

- Bundles > Macro > Stop Recording

- Bundles > Macro > Save Last Recording

That's it. You can maybe assign a shortcut to the macro of course.



--Hans



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