]> code.delx.au - gnu-emacs-elpa/blob - doc/index.html
Updated the introduction doc, thanks Xah Lee for contributing this description
[gnu-emacs-elpa] / doc / index.html
1 <?xml version="1.0" encoding="utf-8" ?>
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4 <head>
5 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6 <meta name="generator" content="Docutils 0.5: http://docutils.sourceforge.net/" />
7 <title>Yet Another Snippet extension</title>
8 <meta name="author" content="pluskid" />
9 <meta name="date" content="2008-03-20" />
10 <link rel="stylesheet" href="styles.css" type="text/css" />
11 </head>
12 <body>
13 <div class="document" id="yet-another-snippet-extension">
14 <div id="header-region" class="clear-block"></div>
15 <div id="wrapper">
16 <div id="container" class="clear-block">
17 <div id="header">
18 <div id="logo-floater">
19 <h1 class="title">Yet Another Snippet extension</h1>
20 </div>
21 <ul class="primary-links">
22 <li>
23 <a title="" href="index.html">Home</a>
24 </li>
25 <li>
26 <a title="" href="define_snippet.html">Howto</a>
27 </li>
28 <li>
29 <a title="" href="faq.html">FAQ</a>
30 </li>
31 <li>
32 <a title="" href="changelog.html">ChangeLog</a>
33 </li>
34 <li>
35 <a title="" href="http://code.google.com/p/yasnippet/downloads/list">Download</a>
36 </li>
37 </ul>
38 </div>
39 <div id="center">
40 <div id="squeeze">
41 <div class="right-corner">
42 <div class="left-corner">
43 <div class="contents topic" id="contents">
44 <p class="topic-title first">Contents</p>
45 <ul class="simple">
46 <li><a class="reference internal" href="#video-demo" id="id1">Video Demo</a></li>
47 <li><a class="reference internal" href="#brief-install-instruction" id="id2">Brief Install Instruction</a><ul>
48 <li><a class="reference internal" href="#bundle-install" id="id3">Bundle Install</a></li>
49 <li><a class="reference internal" href="#normal-install" id="id4">Normal Install</a></li>
50 </ul>
51 </li>
52 <li><a class="reference internal" href="#bugs-contribution-and-support" id="id5">Bugs, Contribution and Support</a></li>
53 </ul>
54 </div>
55 <p>Yasnippet is a template system for emacs. It allows you to type a
56 abbrevation and automatically expand the abbreviation into function
57 templates.</p>
58 <p>Bundled language templates includes: C, C++, C#, Perl, Python, Ruby,
59 SQL, LaTeX, HTML, CSS and more.</p>
60 <p>Yasnippet system is inspired from TextMate's template system. You can
61 use a tool to import any TextMate template you have to Yasnippet. It
62 is a re-design and re-write of my original extension
63 <a class="reference external" href="http://code.google.com/p/smart-snippet/">smart-snippet</a>. It is much cleaner and more powerful than
64 smart-snippet.</p>
65 <div class="section" id="video-demo">
66 <h1><a class="toc-backref" href="#id1">Video Demo</a></h1>
67 <p>Watch the <a class="reference external" href="http://www.youtube.com/watch?v=vOj7btx3ATg">demo at YouTube</a> (download a higher
68 resolution version: <a class="reference external" href="http://yasnippet.googlecode.com/files/yasnippet.avi">yasnippet.avi</a>).</p>
69 </div>
70 <div class="section" id="brief-install-instruction">
71 <h1><a class="toc-backref" href="#id2">Brief Install Instruction</a></h1>
72 <p>There are two archives of YASnippet. One is a single file compiled
73 “bundle”, and the other is normal. If all you need is to use the
74 builtin templates, download the bundle one. If you want to add your
75 own templates, download the normal one.</p>
76 <div class="section" id="bundle-install">
77 <h2><a class="toc-backref" href="#id3">Bundle Install</a></h2>
78 <ul class="simple">
79 <li>Download the latest <tt class="docutils literal"><span class="pre">yasnippet-bundle-x.y.z.el.tgz</span></tt> and unpack it.</li>
80 <li>Open the file, and type <tt class="docutils literal"><span class="pre">Alt+x</span> <span class="pre">eval-buffer</span></tt>.</li>
81 </ul>
82 <p>That's it. Now open any one of your language file, you'll see a menu
83 YASnippet. you can pull the menu to insert a template. Or, you can
84 type the pre-defined abbrev and press <tt class="docutils literal"><span class="pre">TAB</span></tt> to expand it.</p>
85 <p>To have emacs load YASnippet automatically when it starts, put the
86 following in your <tt class="docutils literal"><span class="pre">.emacs</span></tt> file:</p>
87 <blockquote>
88 <div class="highlight"><pre>(<span style="color: #19177C">add-to-list</span> <span style="color: #19177C">&#39;load-path</span>
89 <span style="color: #BA2121">&quot;/path/to/dir/containing/bundle/file&quot;</span>)
90 (<span style="color: #008000">require</span> <span style="color: #19177C">&#39;yasnippet-bundle</span>)
91 </pre></div>
92 </blockquote>
93 </div>
94 <div class="section" id="normal-install">
95 <h2><a class="toc-backref" href="#id4">Normal Install</a></h2>
96 <p>For full install of the normal archive, just download and unpack the
97 latest <tt class="docutils literal"><span class="pre">yasnippet-x.y.z.tar.bz2</span></tt>, put it in your <tt class="docutils literal"><span class="pre">load-path</span></tt> and
98 add the following in your <tt class="docutils literal"><span class="pre">.emacs</span></tt> file:</p>
99 <blockquote>
100 <div class="highlight"><pre>(<span style="color: #008000">require</span> <span style="color: #19177C">&#39;yasnippet</span>) <span style="color: #408080; font-style: italic">;; not yasnippet-bundle</span>
101 (<span style="color: #19177C">yas/initialize</span>)
102 (<span style="color: #19177C">yas/load-directory</span> <span style="color: #BA2121">&quot;/path/to/the/snippets/directory/&quot;</span>)
103 </pre></div>
104 </blockquote>
105 <p>Please refer to the documentation for full customization.</p>
106 </div>
107 </div>
108 <div class="section" id="bugs-contribution-and-support">
109 <h1><a class="toc-backref" href="#id5">Bugs, Contribution and Support</a></h1>
110 <ul class="simple">
111 <li>If you find a bug, please report it at <a class="reference external" href="http://code.google.com/p/yasnippet/issues/list">Issue List</a>.</li>
112 <li>If you have problem using YASnippet, or have some new ideas, please
113 post to the <a class="reference external" href="http://groups.google.com/group/smart-snippet">discussion group</a>. Especially, there's a <a class="reference external" href="http://code.google.com/p/yasnippet/wiki/WishList">wish list</a>
114 wiki page. I'll collect ideas from the <a class="reference external" href="http://groups.google.com/group/smart-snippet">discussion group</a> to the
115 <a class="reference external" href="http://code.google.com/p/yasnippet/wiki/WishList">wish list</a>. So you might want to look at the <a class="reference external" href="http://code.google.com/p/yasnippet/wiki/WishList">wish list</a> before
116 you post something.</li>
117 <li>If you want to contribute some snippets, you can also post them to
118 the <a class="reference external" href="http://groups.google.com/group/smart-snippet">discussion group</a>. Some common snippets may be added to
119 YASnippet, while others will be collected at the
120 <a class="reference external" href="http://code.google.com/p/yasnippet/wiki/UserContributedSnippets">UserContributedSnippets wiki page</a>.</li>
121 </ul>
122 <p>Thank you very much for using YASnippet!</p>
123 </div>
124 </div>
125 </div>
126 </div>
127 </div>
128 </div>
129 </div>
130 </div>
131 </body>
132 </html>