Assorted HTML tips (was: [TxMt] first impressions)

Allan Odgaard throw-away-1 at macromates.com
Thu Oct 20 20:28:26 UTC 2005


On 20/10/2005, at 22.09, Trevor Turk wrote:

> Kevin, thanks for the reply. Sorry if I wasn't clear,
> but a lot of that was just notes. I hope that they
> could be indicative of many users first few questions.
> I noticed that there isn't too much documentation, so
> I started collecting notes as a learned, in the hopes
> that it might be useful for any documentation later.

It is, thanks! :)

Some other tips when working with HTML:

  1) for new tags: type the name of the tag you want and ctrl-cmd  
space, this turns it into <tag></tag> and places caret in the middle.

  2) for wrapping text in a tag: select the text and type ctrl-shift  
W, this wraps the text in a tag pair, and allows you to overtype the  
tag name (and add arguments).

  3) a variant of #2 is when you want to make the text a link, use  
ctrl-shift L instead.

  4) when you want to insert an <img> tag, dropping the image into  
the text area inserts the tag with proper width and height dimensions.

  5) for closing open tags: option-cmd . will insert any </missing>  
tag for the current context.

My own use of HTML is limited to what I put on macromates.com, but  
for that I make frequent use of 1-4, and these can all be edited in  
the bundle editor, e.g. I have a variant of the image drag command  
that scales down the image to 75%, centers it, and makes the image a  
link to the actual image URL (for when I post on my blog) -- I also  
have the ctrl-shift L snippet use the contents of the clipboard for  
the actual href, but this (currently) only works when e.g.  
Quicksilvers clipboard history is enabled (something I'll solve in  
the future).




More information about the textmate mailing list