How to Autocomplete HTML Tags in TextMate?

D. Simpson picture D. Simpson · Apr 5, 2011 · Viewed 8.6k times · Source

I'm going thru Michael Hartl's Ruby on Rails tutorial and, like him, using TextMate as my editor. Today, in chapter 3 of his tutorial, I saw him do something in TextMate I've not seen done before:

As he types a tag in a file called "whatever.html", the tag dynamically updates and creates a corresponding ending tag. So, as an example, if he's typed <ht, then TextMate automatically creates <html></html>, apparently on the fly.

I've found the keystrokes to autocomplete a tag, but this is a little different. Any ideas how this is being done?

Answer

Pablo B. picture Pablo B. · Apr 5, 2011

opt/alt⌥esc⎋ will autocomplete the tag name, ctrl⌃< or ctrl⌃shift⇧, will transform it into open and close tags.

Go to Bundles -> HTML -> Insert Tag menu to find other tag insertion keystrokes.