[TxMt] Re: Things that keep me from switching to TextMate

Jacob Rus jrus at hcs.harvard.edu
Tue Aug 8 16:37:09 UTC 2006


Stefan Haller wrote:
> Jacob Rus <jrus at hcs.harvard.edu> wrote:
> 
>>> - Control-RightArrow should jump by CamelCaps sub-words
>> You can write a macro for this too
> 
> The closest I could get is a macro that searches for the regex
> [A-Z][a-z], and then types left-arrow.  (Actually, the real macro is a
> bit more complicated, but you get the idea.)
> 
> This is already pretty good, but the problem is that it doesn't work
> with the shift key down, which should extend the selection by
> CamelCapsSubWords.  I see no way to achieve that, I think it needs
> support in the editor core so that anchor handling is done right.

Yeah, it requires some cleverness.  This macro I've attached is kind of 
slow, but it gets the job done.  This one does a forward selection, but 
you can do one for backwards selection as well.  The one problem is that 
I'm not sure I can make commands which will take into account where the 
selection is anchored, and shrink the selection from one end.  To really 
solve this problem we'll need some real scripting in TextMate, and 
that's only on the long-term todo from what I understand.

-Jacob

-------------- next part --------------
A non-text attachment was scrubbed...
Name: select camel-case.tmMacro
Type: text/xml
Size: 2216 bytes
Desc: not available
URL: <http://lists.macromates.com/textmate/attachments/20060808/7e3cb424/attachment.tmMacro>


More information about the textmate mailing list