# About Zencoding (Description here](http://www.456bereastreet.com/archive/200909/write_html_and_css_quicker_with_with_zen_coding/) and (here](http://mondaybynoon.com/2009/08/17/the-art-of-zen-coding-bringing-snippets-to-a-new-level/). I’ll quote the blog: > zen-coding includes an entirely new angle to writing markup, and it > facilitates the feature by letting you write HTML based on CSS > selectors. It’s so simple it’s confusing at first. I think it’s best > explained by doing a quick before and after. If you were to type: div#name.one.two > and follow that with the zen-coding plugin keystroke (CMD+E in TextMate), the plugin will reformat the line as:
See the [EmacsWiki for more background on this mode.](http://www.emacswiki.org/emacs/ZenCoding). # Installation Just make sure zencoding-mode.el is in your `load-path`, if you extracted zencoding-mode to a directory: (add-to-list "~/emacs.d/zencoding-mode") And then just require as normal: (require 'zencoding-mode) # Usage Enable it by running `M-x zencoding-mode`. You probably want to add it to auto-load on your sgml modes: (add-hook 'sgml-mode-hook 'zencoding-mode) ;; Auto-start on any markup modes Good to go. # Screenshots and videos * ![Picture of zencoding in action](http://img703.imageshack.us/img703/4474/zencodingmode.png) * [YouTube video]: http://www.youtube.com/watch?v=u2r8JfJJgy8 # Examples ## Basic tags a a.x a#q.x a#q.x.y.z #q \n
\n
.x \n
\n
#q.x \n
\n
#q.x.y.z \n
\n
## Empty tags a/ a/.x a/#q.x a/#q.x.y.z ## Self-closing tags input type=text \n img \n img>metadata/*2 \n\n\n\n ## Siblings a+b a+b+c a.x+b a#q.x+b a#q.x.y.z+b a#q.x.y.z+b#p.l.m.n ## Tag expansion table+ \n\n\n\n\n
\n
dl+ \n
\n
\n
\n
\n
\n
ul+ \n ul++ol+ \n\n
    \n
  1. \n
  2. \n
ul#q.x.y m=l+ \n ## Parent > child a>b a>b>c a.x>b a#q.x>b a#q.x.y.z>b a#q.x.y.z>b#p.l.m.n #q>.x \n
\n
\n
\n
a>b+c a>b+c>d ## Multiplication a*1 a*2 a/*2 a*2+b*2 a*2>b*2 a>b*2 a#q.x>b#q.x*2 a#q.x>b/#q.x*2 ## Properties a x a x= a x="" a x=y a x="y" a x="()" a x m a x= m="" a x=y m=l a/ x=y m=l a#foo x=y m=l a.foo x=y m=l a#foo.bar.mu x=y m=l a/#foo.bar.mu x=y m=l a x=y+b a x=y+b x=y a x=y>b a x=y>b x=y a x=y>b x=y+c x=y ## Parentheses (a) (a)+(b) a>(b) (a>b)>c (a>b)+c z+(a>b)+c+k (a)*2 ((a)*2) ((a)*2) (a>b)*2 (a+b)*2