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

Sylvain Desvé sylvain.desve at mines.inpl-nancy.fr
Sat Sep 1 12:41:29 UTC 2007


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? I'm familiar with  
> the Shift-Cmd-L
> shortcut, but it leaves in the whitespace. This makes a mess of  
> indented HTML
> when I'm using the Ctrl-Shift-W and Ctrl-Shift-Cmd-W HTML shortcuts.
>
> In other words, if I apply the combination Shift-Cmd-L followed by  
> Ctrl-Shift-W
> to this line:
>
>     Here's a paragraph!
>
> I get this:
>
> <p>    Here's a paragraph!
> </p>
>
> instead of what I want, which is this:
>
>     <p>Here's a paragraph!</p>
>
> Obviously I could use the mouse to select only the correct part,  
> but I was
> hoping there might be a keyboard shortcut.
>
> If it's best to create my own macro using Regular Expressions, any  
> pointers as
> to how to get started would be helpful.
>
> Many thanks!
>
> jon
>
>
> ______________________________________________________________________
> For new threads USE THIS: textmate at lists.macromates.com
> (threading gets destroyed and the universe will collapse if you don't)
> http://lists.macromates.com/mailman/listinfo/textmate




More information about the textmate mailing list