]> code.delx.au - gnu-emacs-elpa/blob - doc/index.html
* Fix the multi-line substitution problem
[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.6: http://docutils.sourceforge.net/" />
7 <title>Yet Another Snippet extension</title>
8 <link rel="stylesheet" href="styles.css" type="text/css" />
9 </head>
10 <body>
11 <div class="document" id="yet-another-snippet-extension">
12 <div id="header-region" class="clear-block"></div>
13 <div id="wrapper">
14 <div id="container" class="clear-block">
15 <div id="header">
16 <div id="logo-floater">
17 <h1 class="title">Yet Another Snippet extension</h1>
18 </div>
19 <ul class="primary-links">
20 <li>
21 <a title="" href="index.html">Intro and tutorial</a>
22 </li>
23 <li>
24 <a title="" href="snippet-organization.html">Howto: organize</a>
25 </li>
26 <li>
27 <a title="" href="snippet-expansion.html">Howto: expand</a>
28 </li>
29 <li>
30 <a title="" href="snippet-development.html">Howto: write </a>
31 </li>
32 <li>
33 <a title="" href="snippet-menu.html">Howto: menu </a>
34 </li>
35 <li>
36 <a title="" href="faq.html">FAQ</a>
37 </li>
38 <li>
39 <a title="" href="changelog.html">ChangeLog</a>
40 </li>
41 <li>
42 <a title="" href="http://code.google.com/p/yasnippet/downloads/list">Download</a>
43 </li>
44 </ul>
45 </div>
46 <div id="center">
47 <div id="squeeze">
48 <div class="right-corner">
49 <div class="left-corner">
50 <p>
51 <b>Important:</b> This documentation applies to
52 the <b>SVN trunk</b> of YASnippet, which you
53 get <a href="http://code.google.com/p/yasnippet/source/checkout">here</a>. Documentation
54 for other versions can be found <a title=""
55 href="http://code.google.com/p/yasnippet/downloads/list">here</a>.
56 </p>
57 <div class="contents topic" id="contents">
58 <p class="topic-title first">Contents</p>
59 <ul class="simple">
60 <li><a class="reference internal" href="#video-demo" id="id1">Video Demo</a></li>
61 <li><a class="reference internal" href="#installation" id="id2">Installation</a><ul>
62 <li><a class="reference internal" href="#install-with-yasnippet-bundle-el" id="id3">Install with <tt class="docutils literal"><span class="pre">yasnippet-bundle.el</span></tt></a></li>
63 <li><a class="reference internal" href="#normal-install" id="id4">Normal Install</a></li>
64 </ul>
65 </li>
66 <li><a class="reference internal" href="#how-to-use-yasnippet" id="id5">How to use YASnippet</a></li>
67 <li><a class="reference internal" href="#bugs-contribution-and-support" id="id6">Bugs, Contribution and Support</a></li>
68 </ul>
69 </div>
70 <p><strong>YASnippet</strong> is a template system for Emacs. It allows you to type an
71 abbreviation and automatically expand it into function
72 templates. Bundled language templates includes: C, C++, C#, Perl,
73 Python, Ruby, SQL, LaTeX, HTML, CSS and more.</p>
74 <p>The snippet syntax is inspired from TextMate's syntax, you can even
75 <a class="reference external" href="snippet-development.html#importing-textmate-snippets">import</a>
76 import most TextMate templates. YASnippet is a re-write of the
77 extension <a class="reference external" href="http://code.google.com/p/smart-snippet/">smart-snippet</a>. Both are original creations of <a class="reference external" href="http://pluskid.lifegoo.org">pluskid</a>.</p>
78 <div class="section" id="video-demo">
79 <h1><a class="toc-backref" href="#id1">Video Demo</a></h1>
80 <object type="application/x-shockwave-flash"
81 width="425"
82 height="344"
83 align="right"
84 class="youtube-embed"
85 data="http://www.youtube.com/v/76Ygeg9miao">
86 <param name="movie" value="http://www.youtube.com/v/76Ygeg9miao"></param>
87 <param name="wmode" value="transparent"></param>
88 </object>
89 <p>Watch the <a class="reference external" href="http://www.youtube.com/watch?v=76Ygeg9miao">demo at YouTube</a> (download a higher
90 resolution version: <a class="reference external" href="http://yasnippet.googlecode.com/files/yasnippet.avi">yasnippet.avi</a>).</p>
91 </div>
92 <div class="section" id="installation">
93 <h1><a class="toc-backref" href="#id2">Installation</a></h1>
94 <p>There are two archives you can download. To quickly tryout YASnippet,
95 download the simpler &quot;bundle&quot; version. If you plan to modify the
96 bundled templates and/or build your own, download the &quot;normal&quot;
97 package.</p>
98 <div class="section" id="install-with-yasnippet-bundle-el">
99 <h2><a class="toc-backref" href="#id3">Install with <tt class="docutils literal"><span class="pre">yasnippet-bundle.el</span></tt></a></h2>
100 <ol class="arabic simple">
101 <li>Download the latest <tt class="docutils literal"><span class="pre">yasnippet-bundle-x.y.z.el.tgz</span></tt> and unpack it.</li>
102 <li>You'll get a file named <tt class="docutils literal"><span class="pre">yasnippet-bundle.el</span></tt>, put it under
103 <tt class="docutils literal"><span class="pre">~/.emacs.d/plugins/</span></tt> (create the directory if not exists).</li>
104 <li>Open the file in Emacs, and type <tt class="docutils literal"><span class="pre">Alt+x</span> <span class="pre">eval-buffer</span></tt>.</li>
105 </ol>
106 <p>That's it. Now open any one of your language file, you'll see a menu
107 YASnippet. you can pull the menu to insert a template. Or, you can
108 type the a <em>trigger key</em> then press <tt class="docutils literal"><span class="pre">TAB</span></tt> to expand it.</p>
109 <p>To have Emacs load YASnippet automatically when it starts, put the
110 following in your <tt class="docutils literal"><span class="pre">~/.emacs</span></tt> file:</p>
111 <blockquote>
112 <div class="highlight"><pre>(<span style="color: #19177C">add-to-list</span> <span style="color: #19177C">&#39;load-path</span>
113 <span style="color: #BA2121">&quot;~/.emacs.d/plugins&quot;</span>)
114 (<span style="color: #008000">require</span> <span style="color: #19177C">&#39;yasnippet-bundle</span>)
115 </pre></div>
116 </blockquote>
117 <p>The <a class="reference external" href="http://www.youtube.com/watch?v=76Ygeg9miao">youtube video</a>
118 demonstrates this quick installation.</p>
119 </div>
120 <div class="section" id="normal-install">
121 <h2><a class="toc-backref" href="#id4">Normal Install</a></h2>
122 <p>To install YASnippet as a normal emacs package, download and unpack
123 the latest <tt class="docutils literal"><span class="pre">yasnippet-x.y.z.tar.bz2</span></tt>. You'll get a directory named
124 <tt class="docutils literal"><span class="pre">yasnippet-x.y.z</span></tt>, which you can put it in your
125 <tt class="docutils literal"><span class="pre">~/.emacs.d/plugins</span></tt> and add the following in your <tt class="docutils literal"><span class="pre">.emacs</span></tt> file:</p>
126 <blockquote>
127 <div class="highlight"><pre>(<span style="color: #19177C">add-to-list</span> <span style="color: #19177C">&#39;load-path</span>
128 <span style="color: #BA2121">&quot;~/.emacs.d/plugins/yasnippet-x.y.z&quot;</span>)
129 (<span style="color: #008000">require</span> <span style="color: #19177C">&#39;yasnippet</span>) <span style="color: #408080; font-style: italic">;; not yasnippet-bundle</span>
130 (<span style="color: #19177C">yas/initialize</span>)
131 (<span style="color: #19177C">yas/load-directory</span> <span style="color: #BA2121">&quot;~/.emacs.d/plugins/yasnippet-x.y.z/snippets&quot;</span>)
132 </pre></div>
133 </blockquote>
134 <p>Please refer to the documentation for full customization, or use the
135 customization group.</p>
136 </div>
137 </div>
138 <div class="section" id="how-to-use-yasnippet">
139 <h1><a class="toc-backref" href="#id5">How to use YASnippet</a></h1>
140 <p>Since version 0.6, YASnippet contains more functionality. You don't
141 need to know all of it to use it successfully, but you it can improve
142 your snippeting experience.</p>
143 <p>Hence this section has been split into separate documents:</p>
144 <ol class="arabic simple">
145 <li><a class="reference external" href="snippet-organization.html">Organizing Snippets</a></li>
146 </ol>
147 <blockquote>
148 Describes ways to organize your snippets in the hard disk (or not
149 organize them at all and just use <tt class="docutils literal"><span class="pre">yasnippet-bundle.el</span></tt>.</blockquote>
150 <ol class="arabic simple" start="2">
151 <li><a class="reference external" href="snippet-expansion.html">Expanding Snippets</a></li>
152 </ol>
153 <blockquote>
154 <p>Describes how YASnippet chooses snippets for expansion at point.</p>
155 <p>Maybe, you'll want some snippets to be expanded in a particular
156 mode, or only under certain conditions, or be prompted using
157 <tt class="docutils literal"><span class="pre">ido</span></tt>, etc...</p>
158 </blockquote>
159 <ol class="arabic simple" start="3">
160 <li><a class="reference external" href="snippet-development.html">Writing Snippets</a></li>
161 </ol>
162 <blockquote>
163 Describes the YASnippet definition syntax, which is very close (but
164 not equivalent) to Textmate's. Includes a section about converting
165 TextMate snippets.</blockquote>
166 <ol class="arabic simple" start="4">
167 <li><a class="reference external" href="snippet-menu.html">The YASnippet menu</a></li>
168 </ol>
169 <blockquote>
170 Explains how to use the YASnippet menu to explore, learn and modify
171 snippets.</blockquote>
172 </div>
173 <div class="section" id="bugs-contribution-and-support">
174 <h1><a class="toc-backref" href="#id6">Bugs, Contribution and Support</a></h1>
175 <ul class="simple">
176 <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>
177 <li>If you have problem using YASnippet, or have some new ideas,
178 including snippets, please post to the <a class="reference external" href="http://groups.google.com/group/smart-snippet">discussion group</a>.</li>
179 </ul>
180 <p>Thank you very much for using YASnippet!</p>
181 <!-- LocalWords: YASnippet SQL LaTeX CSS yasnippet el eval html ido RET wiki -->
182 </div>
183 </div>
184 </div>
185 </div>
186 </div>
187 </div>
188 </div>
189 <script type="text/javascript">
190 var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
191 document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
192 </script>
193 <script type="text/javascript">
194 try {
195 var pageTracker = _gat._getTracker("UA-10536822-1");
196 pageTracker._trackPageview();
197 } catch(err) {}
198 </script>
199 </div>
200 </body>
201 </html>