Turbocharging your PHP coding with Sublime Text 2 and Emmet

I’m a PHP developer with a need for speed. I love Sublime Text 2 because it comes jam-packed with helpful features like color coded syntax, intelligent indenting of code and my favorite feature of all, the ability to add packages that enhance what is already a fantastic tool! If you, like me, look for ways to speed up your coding you need to check out the Emmet package for Sublime Text 2! Formerly known as Zen Coding, Emmet uses a powerful abbreviation engine that expands short-hand into fully formed code.

With Emmet installed you can type the following:

Emmet Example 1 Short

And it will expand to this:

Emmet Example 1 Expanded

This is likely familiar to you if you’ve used Zen Coding before but Emmet comes with a few new tricks. Thanks to Emmet’s new ^ operator feature, you can type this:

Emmet Example 2 Short

And get the same expanded code as above! The ^ character tells the abbreviation engine to go up one level and eliminates the need for parentheses in this situation.

Do you use “Lorem ipsum” as placeholder text in your work? Well Emmet has a “Lorem ipsum” generator built right into it! Just expand lorem or lipsum and you’ll get 30 words worth of placeholder text. If you combine the “Lorem ipsum” generator with other elements the generator will keep generating!


Emmet Example 3 Short

And you get this:

Emmet Example 3 Expanded

There’s a lot Emmet can do to speed up your coding! I suggest giving it a try. If you need a bit of help, I recommend the Perfect Workflow in Sublime Text 2 tutorial over at tutsplus.com. Not only is there a video tutorial on Emmet but this tutorial will put you on the right path towards becoming a Sublime Text 2 master.

Sublime Text 2 download
Emmet package download
Emmet documentation

Contact Us

4 thoughts on “Turbocharging your PHP coding with Sublime Text 2 and Emmet

Leave a Reply

Your email address will not be published. Required fields are marked *