[TxMt] Re: Selecting a line without its leading and trailing spaces

Jon Ippolito ron_elicit at yahoo.com
Sun Sep 2 01:49:37 UTC 2007


Sylvain Desvé <sylvain.desve at ...> writes:

> 
> You can record the following macro:
> 
> - CMD + <- To move the cursor to the beggining of the line
> - ALT + -> To go to the first word
> - SHIFT + CMD + -> To select the entire line without the new line  
> character
> - SHIFT + CMD + W To wrap this with html tags
> 
> Sylvain
> 
> Le 1 sept. 07 à 14:10, Jon Ippolito a écrit :
> 
> > Is there a key combination for selecting a line (or lines) of code  
> > in a tag but
> > omitting leading and trailing spaces and tabs? 

Sylvain,

Thanks for this speedy response! This is a good start.

Unfortunately, the behavior of Alt/Option + -> seems a bit unpredictable: it
skips over non-word characters like " and <, and entire words when only one tab
is present at left. Also, Cmd + <-/-> won't find the beginning or end of a
wrapped line, only the last character before it was wrapped.

However, your thought suggested to me a macro based on RegExp searches, which
seems to work:

Find previous $
Find next \S(.+?)\n
Shift + <-

I appreciate the inspiration!

jon






More information about the textmate mailing list