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">
5 <meta http-equiv=
"Content-Type" content=
"text/html; charset=utf-8" />
6 <meta name=
"generator" content=
"Docutils 0.4: http://docutils.sourceforge.net/" />
7 <title>YASnippet - Yet Another Snippet extension for Emacs
</title>
8 <meta name=
"author" content=
"pluskid" />
9 <meta name=
"date" content=
"2008-03-20" />
10 <style type=
"text/css">
13 :Author: David Goodger
14 :Contact: goodger@users.sourceforge.net
15 :Date: $Date:
2005-
12-
18 01:
56:
14 +
0100 (Sun,
18 Dec
2005) $
16 :Revision: $Revision:
4224 $
17 :Copyright: This stylesheet has been placed in the public domain.
19 Default cascading style sheet for the HTML output of Docutils.
21 See http://docutils.sf.net/docs/howto/html-stylesheets.html for how to
22 customize this style sheet.
25 /* used to remove borders from tables and images */
26 .borderless, table.borderless td, table.borderless th {
29 table.borderless td, table.borderless th {
30 /* Override padding for
"table.docutils td" with
"! important".
31 The right padding separates the table cells. */
32 padding:
0 0.5em
0 0 ! important }
35 /* Override more specific margin styles with
"! important". */
36 margin-top:
0 ! important }
38 .last, .with-subtitle {
39 margin-bottom:
0 ! important }
45 text-decoration: none ;
52 margin-bottom:
0.5em }
54 /* Uncomment (and remove this text!) to get bold-faced definition list terms
62 div.abstract p.topic-title {
66 div.admonition, div.attention, div.caution, div.danger, div.error,
67 div.hint, div.important, div.note, div.tip, div.warning {
69 border: medium outset ;
72 div.admonition p.admonition-title, div.hint p.admonition-title,
73 div.important p.admonition-title, div.note p.admonition-title,
74 div.tip p.admonition-title {
76 font-family: sans-serif }
78 div.attention p.admonition-title, div.caution p.admonition-title,
79 div.danger p.admonition-title, div.error p.admonition-title,
80 div.warning p.admonition-title {
83 font-family: sans-serif }
85 /* Uncomment (and remove this text!) to get reduced vertical space in
87 div.compound .compound-first, div.compound .compound-middle {
88 margin-bottom:
0.5em }
90 div.compound .compound-last, div.compound .compound-middle {
99 div.dedication p.topic-title {
107 div.footer, div.header {
116 div.line-block div.line-block {
123 border: medium outset ;
125 background-color: #ffffee ;
130 div.sidebar p.rubric {
131 font-family: sans-serif ;
134 div.system-messages {
137 div.system-messages h1 {
141 border: medium outset ;
144 div.system-message p.system-message-title {
151 h1.section-subtitle, h2.section-subtitle, h3.section-subtitle,
152 h4.section-subtitle, h5.section-subtitle, h6.section-subtitle {
170 ol.simple, ul.simple {
174 list-style: decimal }
177 list-style: lower-alpha }
180 list-style: upper-alpha }
183 list-style: lower-roman }
186 list-style: upper-roman }
200 white-space: nowrap }
209 font-family: sans-serif ;
214 font-family: sans-serif ;
226 pre.literal-block, pre.doctest-block {
229 background-color: #eeeeee }
232 font-family: sans-serif ;
233 font-style: oblique }
235 span.classifier-delimiter {
236 font-family: sans-serif ;
240 font-family: sans-serif }
243 white-space: nowrap }
251 span.section-subtitle {
252 /* font-size relative to parent (h1..h6 element) */
256 border-left: solid
1px gray;
264 margin-bottom:
0.5em }
267 border-left: solid
1px black;
270 table.docutils td, table.docutils th,
271 table.docinfo td, table.docinfo th {
272 padding-left:
0.5em ;
273 padding-right:
0.5em ;
274 vertical-align: top }
276 table.docutils th.field-name, table.docinfo th.docinfo-name {
279 white-space: nowrap ;
282 h1 tt.docutils, h2 tt.docutils, h3 tt.docutils,
283 h4 tt.docutils, h5 tt.docutils, h6 tt.docutils {
287 background-color: #eeeeee }
290 list-style-type: none }
295 <div class=
"document" id=
"yasnippet-yet-another-snippet-extension-for-emacs">
296 <h1 class=
"title">YASnippet - Yet Another Snippet extension for Emacs
</h1>
297 <table class=
"docinfo" frame=
"void" rules=
"none">
298 <col class=
"docinfo-name" />
299 <col class=
"docinfo-content" />
301 <tr><th class=
"docinfo-name">Author:
</th>
302 <td>pluskid
</td></tr>
303 <tr><th class=
"docinfo-name">Contact:
</th>
304 <td><a class=
"first last reference" href=
"mailto:pluskid@gmail.com">pluskid
@gmail.com
</a></td></tr>
305 <tr><th class=
"docinfo-name">Date:
</th>
306 <td>2008-
03-
20</td></tr>
309 <div class=
"contents topic">
310 <p class=
"topic-title first"><a id=
"contents" name=
"contents">Contents
</a></p>
312 <li><a class=
"reference" href=
"#getting-started" id=
"id5" name=
"id5">Getting Started
</a><ul>
313 <li><a class=
"reference" href=
"#for-the-busy-or-impatient-people" id=
"id6" name=
"id6">For the busy or impatient people
</a></li>
314 <li><a class=
"reference" href=
"#for-lazy-poeple-or-beginners" id=
"id7" name=
"id7">For lazy poeple or beginners
</a></li>
315 <li><a class=
"reference" href=
"#for-you" id=
"id8" name=
"id8">For you
</a></li>
316 <li><a class=
"reference" href=
"#for-geeks" id=
"id9" name=
"id9">For geeks
</a></li>
319 <li><a class=
"reference" href=
"#how-to-contribute" id=
"id10" name=
"id10">How to contribute ?
</a><ul>
320 <li><a class=
"reference" href=
"#issues" id=
"id11" name=
"id11">Issues
</a></li>
321 <li><a class=
"reference" href=
"#suggestion-feature-request" id=
"id12" name=
"id12">Suggestion, Feature Request
</a></li>
322 <li><a class=
"reference" href=
"#snippets" id=
"id13" name=
"id13">Snippets
</a></li>
325 <li><a class=
"reference" href=
"#detailed-documentation" id=
"id14" name=
"id14">Detailed Documentation
</a></li>
328 <p>YASnippet is a re-design and re-write of my original extension
329 <a class=
"reference" href=
"http://code.google.com/p/smart-snippet/">smart-snippet
</a>. It is much cleaner and more powerful than
331 <div class=
"section">
332 <h1><a class=
"toc-backref" href=
"#id5" id=
"getting-started" name=
"getting-started">Getting Started
</a></h1>
333 <div class=
"section">
334 <h2><a class=
"toc-backref" href=
"#id6" id=
"for-the-busy-or-impatient-people" name=
"for-the-busy-or-impatient-people">For the busy or impatient people
</a></h2>
335 <p>Watch the
<a class=
"reference" href=
"http://www.youtube.com/watch?v=vOj7btx3ATg">screencast at YouTube
</a> or download
<a class=
"reference" href=
"http://yasnippet.googlecode.com/files/yasnippet.avi">the one
336 with a higher resolution
</a>.
</p>
338 <div class=
"section">
339 <h2><a class=
"toc-backref" href=
"#id7" id=
"for-lazy-poeple-or-beginners" name=
"for-lazy-poeple-or-beginners">For lazy poeple or beginners
</a></h2>
341 <li><p class=
"first">Download the latest bundle release
<a class=
"footnote-reference" href=
"#id3" id=
"id1" name=
"id1">[
1]
</a> from the
<a class=
"reference" href=
"http://code.google.com/p/yasnippet/downloads/list">downloads page
</a>.
</p>
343 <li><p class=
"first">Create a directory
<tt class=
"docutils literal"><span class=
"pre">~/emacs/plugins
</span></tt>.
</p>
345 <li><p class=
"first">Unpack the downloaded bundle to that directory.
</p>
347 <li><p class=
"first">Add the following code to your
<tt class=
"docutils literal"><span class=
"pre">~/.emacs
</span></tt> file:
</p>
348 <div class=
"highlight"><pre>(
<span style=
"color: #19177C">add-to-list
</span> <span style=
"color: #19177C">'load-path
</span>
349 <span style=
"color: #BA2121">"~/emacs/plugins
"</span>)
350 (
<span style=
"color: #008000">require
</span> <span style=
"color: #19177C">'yasnippet-bundle
</span>)
355 <div class=
"section">
356 <h2><a class=
"toc-backref" href=
"#id8" id=
"for-you" name=
"for-you">For you
</a></h2>
358 <li><p class=
"first">Download the latest YASnippet release package
<a class=
"footnote-reference" href=
"#id4" id=
"id2" name=
"id2">[
2]
</a> from the
359 <a class=
"reference" href=
"http://code.google.com/p/yasnippet/downloads/list">downloads page
</a>.
</p>
361 <li><p class=
"first">Unpack it to a directory and add that directory to your
362 <tt class=
"docutils literal"><span class=
"pre">load-path
</span></tt>.
</p>
364 <li><p class=
"first">Add the following code to your
<tt class=
"docutils literal"><span class=
"pre">~/.emacs
</span></tt> file:
</p>
365 <div class=
"highlight"><pre>(
<span style=
"color: #008000">require
</span> <span style=
"color: #19177C">'yasnippet
</span>)
<span style=
"color: #408080; font-style: italic">;; not yasnippet-bundle
</span>
366 (
<span style=
"color: #19177C">yas/initialize
</span>)
367 (
<span style=
"color: #19177C">yas/load-directory
</span> <span style=
"color: #BA2121">"/path/to/the/snippets/directory/
"</span>)
370 <li><p class=
"first">You can inspect into the
<tt class=
"docutils literal"><span class=
"pre">snippets
</span></tt> directory for adding your own
373 <li><p class=
"first">Detailed document can be found at the
<tt class=
"docutils literal"><span class=
"pre">doc
</span></tt> directory.
</p>
377 <div class=
"section">
378 <h2><a class=
"toc-backref" href=
"#id9" id=
"for-geeks" name=
"for-geeks">For geeks
</a></h2>
379 <p>If you want to always follow the latest code. You can check out it
380 from the svn repository:
</p>
381 <div class=
"highlight"><pre>svn checkout http://yasnippet.googlecode.com/svn/trunk/ yasnippet
383 <p>However, I try to release a new version as soon as I made some changes
384 that will affect the normal use or added some new features. So there's
385 usually no need to follow the svn repository. Except that you might
386 find
<tt class=
"docutils literal"><span class=
"pre">svn
</span> <span class=
"pre">up
</span></tt> is more convenient than downloading and unpacking the
387 release package. :D
</p>
390 <div class=
"section">
391 <h1><a class=
"toc-backref" href=
"#id10" id=
"how-to-contribute" name=
"how-to-contribute">How to contribute ?
</a></h1>
392 <p>If you like YASnippet, you can recommendate it to your friends.
</p>
393 <div class=
"section">
394 <h2><a class=
"toc-backref" href=
"#id11" id=
"issues" name=
"issues">Issues
</a></h2>
395 <p>If you find a bug you can create a new issue at the
<a class=
"reference" href=
"http://code.google.com/p/yasnippet/issues/list">issue list
</a>. Please describe
396 the problem as clear as possible.
</p>
398 <div class=
"section">
399 <h2><a class=
"toc-backref" href=
"#id12" id=
"suggestion-feature-request" name=
"suggestion-feature-request">Suggestion, Feature Request
</a></h2>
400 <p>There's a
<a class=
"reference" href=
"http://groups.google.com/group/smart-snippet">discussion group
</a> for both smart-snippet and yasnippet. If
401 you have any suggesion, you can post to there and discuss with other
403 <p>Especially, there's a
<a class=
"reference" href=
"http://code.google.com/p/yasnippet/wiki/WishList">wish list
</a> wiki page. I'll collect ideas from
404 the
<a class=
"reference" href=
"http://groups.google.com/group/smart-snippet">discussion group
</a> to the
<a class=
"reference" href=
"http://code.google.com/p/yasnippet/wiki/WishList">wish list
</a>. So you might want to look
405 at the
<a class=
"reference" href=
"http://code.google.com/p/yasnippet/wiki/WishList">wish list
</a> before you post something.
</p>
407 <div class=
"section">
408 <h2><a class=
"toc-backref" href=
"#id13" id=
"snippets" name=
"snippets">Snippets
</a></h2>
409 <p>YASnippet comes with some default snippet definitions. However, they
410 are far from complete. So I'm calling users to share their
411 snippets. If you have some good snippet definitions, you can post them
412 to the
<a class=
"reference" href=
"http://groups.google.com/group/smart-snippet">discussion group
</a>. You can specify the
<tt class=
"docutils literal"><span class=
"pre">contributor
</span></tt>
413 property of the snippet like:
</p>
414 <div class=
"highlight"><pre>#contributor : pluskid
<pluskid@gmail.com
>
419 <p>I'll incorporate (some of) them in the release if suitable. However,
420 if you have
<em>many
</em> snippets (especially when they need to be
421 maintained and updated constantly), it is not suitable to put them in
422 the YASnippet release package. A better way is to make your snippets
423 publicly available and tell me the URL. I'll try to keep a list of
424 them on the wiki page.
</p>
427 <div class=
"section">
428 <h1><a class=
"toc-backref" href=
"#id14" id=
"detailed-documentation" name=
"detailed-documentation">Detailed Documentation
</a></h1>
430 <li>See
<a class=
"reference" href=
"define_snippet.html">this page
</a> on how to define a snippet by
432 <li>Here's the
<a class=
"reference" href=
"faq.html">FAQ
</a> page.
</li>
434 <table class=
"docutils footnote" frame=
"void" id=
"id3" rules=
"none">
435 <colgroup><col class=
"label" /><col /></colgroup>
437 <tr><td class=
"label"><a class=
"fn-backref" href=
"#id1" name=
"id3">[
1]
</a></td><td>They usually named like
<tt class=
"docutils literal"><span class=
"pre">yasnippet-bundle-x.y.z.el.tgz
</span></tt> where
438 <tt class=
"docutils literal"><span class=
"pre">x.y.z
</span></tt> is the version number.
</td></tr>
441 <table class=
"docutils footnote" frame=
"void" id=
"id4" rules=
"none">
442 <colgroup><col class=
"label" /><col /></colgroup>
444 <tr><td class=
"label"><a class=
"fn-backref" href=
"#id2" name=
"id4">[
2]
</a></td><td>They usually named like
<tt class=
"docutils literal"><span class=
"pre">yasnippet.x.y.z.tar.bz2
</span></tt>.
</td></tr>