[TxMt] Smart Home/End

Benjamin Jackson ben at incomumdesign.com
Tue Nov 8 14:16:19 UTC 2005


> On 31/10/2005, at 10.59, Frédérik Bilhaut wrote:
>
> > I was wondering if TextMate has the feature often called "smart
> > home/end" in other editors ? [...]
>
> It doesn't, but you could record a macro which does:
>
>   1) move to beginning of line (ctrl A)
>   2) regexp search for: (?=\S|$)
>
> And bind that to the home key. For smart end you'd search for: (?=\s*$

Actually, this moves to the second column with lines that have no 
whitespace at the front. It'd be better to do:

   1) move to beginning of line (ctrl A)
   2) regexp search for: (?<=\S|$)
   3) move left

The regexp uses a look-behind to place the cursor after the first 
non-whitespace character. Cheers,

Ben
___________________
Ben Jackson
Diretor de Desenvolvimento

ben at incomumdesign.com
http://www.incomumdesign.com



More information about the textmate mailing list