From The Blog

TextMate Tip: HTML Tags

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...

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.

Other Posts That Might Interest You

  1. TextMate Tips: Opening and Moving Around in Files with Bonus!
  2. TextMate Tip: SQL Browser
  3. !nil != not nil

Tags: 

  • 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!
  • Chris
    Why would you be using TextMate on Windows? :)

    Or maybe, how?
  • 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
  • Steven
    The Command-key icon (Apple) does not show in firefox.
blog comments powered by Disqus