Tuesday, February 9, 2010

You are here: Home > Articles > TextMate Tip: HTML Tags

TextMate Tip: HTML Tags

by Chris Kaukis on March 6, 2008

Have you ever just wanted to select some text and wrap it in a tag instead of jumping to the beginning and end of the lines? Or perhaps you get tired of remembering to close your tags as you go and you wish it was done for you. Both are possible, you just have to know the right keystrokes.

In any HTML editing mode in TextMate (HTML, HTML (Rails), etc) try the following then start typing:

Shift + ctrl + W

You can also select text you want to wrap in the tag.

Click here to view the screencast and see an example

In the screencast, I also used another nice little shortcut.

 + return

This will do a carriage return to the next line starting at the end of the current line, not at the current cursor location.

The Fine Print: It’s my first screencast, it might suck.

Bookmark and Share
  • Steven
    The Command-key icon (Apple) does not show in firefox.
  • Arnaud M
    I think you should refrain from using the "apple" character, it does not show correctly outside Macs (tried on Windows Opera, IE, Firefox and Safari). Stick to Cmd+Key
  • Chris
    Why would you be using TextMate on Windows? :)

    Or maybe, how?
  • Ed
    Actually, for the record, I'm viewing this on Safari 4.02 on Leopard 10.5.7 and the 'apple' character isn't showing up for me, either. Too bad, because these are some great, handy little tips. I appreciate it!
blog comments powered by Disqus

Previous post:

Next post: