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

Jon Ippolito ron_elicit at yahoo.com
Sat Sep 1 12:10:53 UTC 2007


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




More information about the textmate mailing list