From bmf@email.arizona.edu Wed Jul 27 18:22:43 2011 From: Brandon M Fryslie To: textmate@lists.macromates.com Subject: [TxMt] Re: Wrap Selection as Link Date: Wed, 27 Jul 2011 11:22:40 -0700 Message-ID: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1520611461369333241==" --===============1520611461369333241== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit I'm not sure which command you are originally referring to, but this is pretty easy to just whip up in the bundle editor (thank you, TextMate!). Create a new snippet. You can name the snippet whatever, and assign it to whatever keyboard shortcut. Just make sure to put 'text.html' in the 'Scope Selector' field. This will make sure the keyboard shortcut only activates when you are in an HTML document*. So, here is the snippet: $TM_SELECTED_TEXT Just paste that into the bundle editor window (get rid of any extra whitespace), close the bundle editor, and baby you got a stew goin'! Highlight some text and press your keyboard shortcut to make a new anchor. The caret will be in the quotes where the $1 is. * More correctly, it will be active when the caret is in a scope of text.html. You can check the scope at any time by using a keyboard shortcut, but I think it's disabled by default. To enable it, click the 'Filter List...' button near the bottom of the bundle editor, and click the checkbox by the bundle titled 'Bundle Development'. Once that is enabled, press control+shift+p to see a tooltip with the scope hierarchy in it. There's documentation about this stuff on the TextMate site if you are interested in learning more. --===============1520611461369333241== Content-Type: text/html Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="attachment.htm" MIME-Version: 1.0 SSYjMzk7bSBub3Qgc3VyZSB3aGljaCBjb21tYW5kIHlvdSBhcmUgb3JpZ2luYWxseSByZWZlcnJp bmcgdG8sIGJ1dCB0aGlzIGlzIHByZXR0eSBlYXN5IHRvIGp1c3Qgd2hpcCB1cCBpbiB0aGUgYnVu ZGxlIGVkaXRvciAodGhhbmsgeW91LCBUZXh0TWF0ZSEpLiCgQ3JlYXRlIGEgbmV3IHNuaXBwZXQu IKBZb3UgY2FuIG5hbWUgdGhlIHNuaXBwZXQgd2hhdGV2ZXIsIGFuZCBhc3NpZ24gaXQgdG8gd2hh dGV2ZXIga2V5Ym9hcmQgc2hvcnRjdXQu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