Quick Tip: Wrap Selection in Tag

I have a quick tip for today that I probably use every time TextMate is open. It has two function and is highly useful. Think about how many times you write something that needs to be wrapped in a tag. Probably very often I would guess. There’s a handy shortcut to make your life easier and it’s simply ⌃⇧W (Ctrl + Shift + W). This will wrap your selection in a list element tag by default but you can type whatever tag you need (along with the parameters). I use this on numerous links, paragraphs, spans, etc.

An even nicer part is the sibling to this function. It wraps every line in your selection with the tag of your choice. This is really useful for things like ordered lists. It’s the same keyboard shortcut with the addition of command (Ctrl + Shift + Cmd + W). I’ve included a short video snippet of how this might be useful to you while coding. Enjoy!

Share and Enjoy:
  • Digg
  • del.icio.us
  • Facebook
  • Google
  • Reddit
  • Slashdot
  • StumbleUpon
  • Technorati

About the Author

Name: Erik

All tips by Erik

Erik is a husband, father, web developer and musician working in Savannah, Georgia. He loves the smell of TextMate in the morning! You can catch him around Twitter @ErikReagan

If you enjoyed this post, please consider to leave a comment or subscribe to the feed and get future articles delivered to your feed reader.

Comments

Excellent tip! This just saved me 30 minutes!

Leave a comment