10

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?

4 Answers 4

15

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.

1

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

1
  • It's close, but I'd swear it's happening "live"... I'm watching a video screencast and watching his tags update as he types... I'll have to live with CTRL< for now, I guess!
    – D. Simpson
    Apr 5, 2011 at 22:05
1

Check out this link to a screencast on the Textmate website. I had the same question that you have b/c I'm working through Michael Hartl's video tutorial, and I had to find out how he was doing this.

http://screencasts.textmate.org/insert_html_tags.mov

Enjoy!

0

To get the open and close tags press the keys

Control Shift ,
this is same as
Control <

Hope this helps.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.