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.
Another neat trick I saw on a blog (but unfortunately lost the reference) was a command configured to do: open http://php.net/%24TM_CURRENT_WORD
So simple, and yet so powerful (it looks up the word under the caret in the PHP reference documentation).
It's really fantastic to see this end-user innovation, keep it up! :)
Kind regards Allan
On 8. Oct 2004, at 5:48, 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.
Pressing ctrl-w first (select word) will make it work for the current word (w/o a selection), and if there's already a selection, it will expand the selection to word boundaries, which it most likely already is. So this makes it easier for single words which needs to be embedded.
Another neat trick I saw on a blog (but unfortunately lost the reference) was a command configured to do:
And here's the link: http://sneer.org/archives/2004/10/06/textmate_first_impressions/
Kind regards Allan
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/%24TM_CURRENT_WORD
Added this to the PHP bundle for 1.0.1 too :)
Justin
On Oct 7, 2004, at 10:48 PM, Allan Odgaard wrote:
Another neat trick I saw on a blog (but unfortunately lost the reference) was a command configured to do: open http://php.net/%24TM_CURRENT_WORD
Ah, it's amazing what you can do when you have a completely flat namespace, eh? No hierarchy of commands to muck up your search engine. :-)
(I did PHP for a number of years, but I'm all better now.)