[TextMate] [Tip] Embed selection in tag, lookup PHP functions

Justin French justin.french at indent.com.au
Fri Oct 8 05:47:46 UTC 2004


On 08/10/2004, at 1:48 PM, Allan Odgaard wrote:

> James A. Baker asked me for a BBEdit feature where the selection is 
> wrapped in a tag, which you pick from a list of tags. But then his 
> stream of thoughts derived the following TextMate solution, which I 
> think was very neat:
>
> Create this snippet, name it _wtag:
>    <${2:tt}>$1</${2:tt}>$0
>
> Then select Start Macro Recording and type:
>    cmd-x, _wtag, tab, cmd-v, tab, stop recording, save it for later.
>
> Now you have a macro which wraps the current selection inside a tag 
> pair (the default tag name is tt, but you can change it). Press tab 
> again after having typed the name to leave the snippet.

Added this to the HTML bundle for 1.0.1 (include a ^W word selection 
first).


> Another neat trick I saw on a blog (but unfortunately lost the 
> reference) was a command configured to do:
>    open http://php.net/$TM_CURRENT_WORD

Added this to the PHP bundle for 1.0.1 too :)


Justin




More information about the textmate mailing list