Alex Henning home about projects blog

ZenCoding for Emacs

ZenCoding allows extremely easy html generation by typing shortcut text. With it:

html>(head>body>title)+(div#main>h1+div#content)+(div#sidebar>ul>li*5)

Becomes

 1:  <html>
 2:    <head>
 3:      <body>
 4:        <title>
 5:        </title>
 6:      </body>
 7:    </head>
 8:    <div id="main">
 9:      <h1></h1>
10:      <div id="content">
11:      </div>
12:    </div>
13:    <div id="sidebar">
14:      <ul>
15:        <li>
16:        </li>
17:        <li>
18:        </li>
19:        <li>
20:        </li>
21:        <li>
22:        </li>
23:        <li>
24:        </li>
25:      </ul>
26:    </div>
27:  </html>  
28:  

You can use it alongside YASnippet to make html actually… fun to write. Between the two of the, you can ignore most of the cruft of html.

If you want to use it, get it from github and load it in your .emacs:

1:  (add-to-list 'load-path "~/.emacs.d/zencoding/")
2:  (require 'zencoding-mode)
3:  (add-hook 'sgml-mode-hook 'zencoding-mode)
4:  

And type C-<RET> <RET> to expand the zencode line.

Posted on 26 October 2010 in emacs zencoding

<Previous: Yahoo Pipes, Easy Custom AlertsNext: MIT Doesn't use the Common App>

blog comments powered by Disqus