[TxMt] Re: Help with simple text conversion command

Nick ParadoxQuine at gmail.com
Wed Nov 19 20:55:05 UTC 2008


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 at 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 at lists.macromates.com
> http://lists.macromates.com/listinfo/textmate
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macromates.com/textmate/attachments/20081119/39441cd3/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Custom Text Editing Commands.tmbundle.zip
Type: application/zip
Size: 2036 bytes
Desc: not available
URL: <http://lists.macromates.com/textmate/attachments/20081119/39441cd3/attachment.zip>


More information about the textmate mailing list