Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to Autocomplete HTML Tags in TextMate?

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?

like image 961
D. Simpson Avatar asked Apr 05 '11 20:04

D. Simpson


2 Answers

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.

like image 98
Pablo B. Avatar answered Sep 21 '22 21:09

Pablo B.


Check Bundles -> Html for all the different keystrokes you can use. I'm guessing this could be the Ctrl-< keystroke.

like image 38
Effata Avatar answered Sep 18 '22 21:09

Effata