Don’t wait, head over to VS extensions gallery and grab hold of Web Essentials 2012 by Mads Kristensen. The extension offers good amount of features for VS based developers, of all of them the one I am going to talk about is the Zen Coding style introduced by Sergey Chikuyonok (as mentioned in JohnPapa.net).
Before I proceed further Zen Coding style has been implemented across various text editors, and if you are a full time or regular web developer you should have a look into it. For all the supported text editors check out the Wikipedia entry at http://en.wikipedia.org/wiki/Zen_Coding#Text_editors.
Once you have installed Web Essentials 2012, you will have support for coding in Zen Coding style development inside of Visual Studio 2012. The main idea behind the coding style is to reduce the manual typing process of creating the mundane html code for your web application. It is kind of text expansion mechanism, but it is much more than that.
Lets start with few examples:
|
|
as simple as that. In the above example itself you have skipped over typing all the angle brackets and the end tag of the div.
*
and item numbering $
|
|
Check out that you can repeat items using the syntax li*3
which simply creates that many items and you can specify what you would want to go inside the tag by using the curly braces. So li{hi}
would create:
|
|
Also note that you can access the current index of the element using $
symbol, and when you use $$
it does the padding for you.
#
, class .
and custom attributes []
|
|
+
I am sure by now you understand that >
creates child elements, similarly for creating siblings you can use the +
element
|
|
^
|
|
lorem3
|
|
Unfortunately, as of Web Essentials 2012 v2.3.1 grouping is not supported yet. So you may want to write to Kris about the same and request for the feature.
Overall Zen Coding style saves a lot of mundane typing that comes with html file development, and I hope this helps you as much as it has helped me.
Do check out Web Essentials as it is much more than an extension which supports Zen Coding style.