seventheyejosh Posted April 23, 2010 Share Posted April 23, 2010 Has anyone used this? It is pretty awesome. First Vid: http://net.tutsplus.com/tutorials/tools-and-tips/learn-how-to-write-lightning-fast-code-in-4-minutes-screencast/ Advanced Vid: Source: http://code.google.com/p/zen-coding/ Noobs http://www.w3.org/TR/CSS2/selector.html Quote Link to comment https://forums.phpfreaks.com/topic/199539-zen-coding/ Share on other sites More sharing options...
webmaster1 Posted April 24, 2010 Share Posted April 24, 2010 Interesting. Can you explain it to me briefly in your own words? Quote Link to comment https://forums.phpfreaks.com/topic/199539-zen-coding/#findComment-1047437 Share on other sites More sharing options...
seventheyejosh Posted April 24, 2010 Author Share Posted April 24, 2010 Ya it is really slick if you are sick of typing out all your ul's and li's or even your divs. I use Komodo Edit on Snow Leopard, so I grabbed it for that, but our house designer got it for Aptana, and it works the same. It has a couple of commands, but I just use (so far) the Expand Abbreviation, which I mapped to Ctrl+, and Wrap Abbreviation, which I mapped to Ctrl+Shift+,. So anyway, the idea is you type a string of text, using css selectors, and hit your hotkey at the end of the line, and volia, html! You can use any element, ul, div, head, etc You can use # for id, . for class, * for iterations, and $ for the number of the current iterator SO.... Type: div#mydiv Hit hotkey at end of line Result: <div id="mydiv></div> Type: ul#mynav>li*3 Hit hotkey at end of line Result: <ul id="mynav"> <li></li> <li></li> <li></li> </ul> Type: ul#mynav>li.item-$*3 Hit hotkey at end of line Result: <ul id="mynav"> <li class="item-1"></li> <li class="item-1"></li> <li class="item-1"></li> </ul> Type: html>head+body>div#wrapper>div#header+div#left+div#right+div#footer>ul.navigation>li.item-$*5>a Hit hotkey at end of line Result: <html> <head></head> <body> <div id="wrapper"> <div id="header"></div> <div id="left"></div> <div id="right"></div> <div id="footer"> <ul class="navigation"> <li class="item-1"><a href=""></a></li> <li class="item-2"><a href=""></a></li> <li class="item-3"><a href=""></a></li> <li class="item-4"><a href=""></a></li> <li class="item-5"><a href=""></a></li> </ul> </div> </div> </body> </html> And the other thing you can do is wrap, using just *, with no amount to detect the items. Nice if you have a list of items. Type: Home About Us Contact Shop Forum HIGHLIGHT ALL, Hit Wrap Abbreviation hotkey. Type: ul#mynav>li.item$* Hit Ok Gives: <ul id="mynav"> <li class="item-1">Home</li> <li class="item-2">About Us</li> <li class="item-3">Contact</li> <li class="item-4">Shop</li> <li class="item-5">Forum</li> </ul> Pretty sick eh? Quote Link to comment https://forums.phpfreaks.com/topic/199539-zen-coding/#findComment-1047468 Share on other sites More sharing options...
ignace Posted April 24, 2010 Share Posted April 24, 2010 Yes I have been using it for a while now. PhpStorm implements it natively. Quote Link to comment https://forums.phpfreaks.com/topic/199539-zen-coding/#findComment-1047545 Share on other sites More sharing options...
webmaster1 Posted April 24, 2010 Share Posted April 24, 2010 Very interesting stuff. Thanks for the overview Josh. Quote Link to comment https://forums.phpfreaks.com/topic/199539-zen-coding/#findComment-1047786 Share on other sites More sharing options...
seventheyejosh Posted April 25, 2010 Author Share Posted April 25, 2010 No problem! If you use advanced selectors for css or jQuery it is second nature. And there are no syntax errors, the missing quotes above was me just typing it out lol Quote Link to comment https://forums.phpfreaks.com/topic/199539-zen-coding/#findComment-1047828 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.