mirror of
https://github.com/joaotavora/yasnippet.git
synced 2026-02-04 06:32:24 +00:00
@@ -7,7 +7,7 @@
|
||||
<meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"/>
|
||||
<meta name="title" content="Writing snippets"/>
|
||||
<meta name="generator" content="Org-mode"/>
|
||||
<meta name="generated" content="2013-12-24T11:50-0500"/>
|
||||
<meta name="generated" content="2014-05-11T19:37-0400"/>
|
||||
<meta name="author" content=""/>
|
||||
<meta name="description" content=""/>
|
||||
<meta name="keywords" content=""/>
|
||||
@@ -154,7 +154,9 @@ for the JavaScript code in this tag.
|
||||
<li><a href="#sec-2-4"><code># group:</code> snippet menu grouping</a></li>
|
||||
<li><a href="#sec-2-5"><code># expand-env:</code> expand environment</a></li>
|
||||
<li><a href="#sec-2-6"><code># binding:</code> direct keybinding</a></li>
|
||||
<li><a href="#sec-2-7"><code># contributor:</code> snippet author</a></li>
|
||||
<li><a href="#sec-2-7"><code># type:</code> <code>snippet</code> or <code>command</code></a></li>
|
||||
<li><a href="#sec-2-8"><code># uuid:</code> unique identifier</a></li>
|
||||
<li><a href="#sec-2-9"><code># contributor:</code> snippet author</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="#sec-3">Template syntax</a>
|
||||
@@ -458,10 +460,43 @@ will expand the paragraph tag without newlines.
|
||||
</div>
|
||||
|
||||
<div id="outline-container-2-7" class="outline-3">
|
||||
<h3 id="sec-2-7"><code># contributor:</code> snippet author</h3>
|
||||
<h3 id="sec-2-7"><code># type:</code> <code>snippet</code> or <code>command</code></h3>
|
||||
<div class="outline-text-3" id="text-2-7">
|
||||
|
||||
|
||||
<p>
|
||||
If the <code>type</code> directive is set to <code>command</code>, the body of the snippet
|
||||
is interpreted as lisp code to be evaluated when the snippet is
|
||||
triggered.
|
||||
</p>
|
||||
<p>
|
||||
If it's <code>snippet</code> (the default when there is no <code>type</code> directive), the
|
||||
snippet body will be parsed according to the <a href="#sec-3">Template Syntax</a>,
|
||||
described below.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="outline-container-2-8" class="outline-3">
|
||||
<h3 id="sec-2-8"><code># uuid:</code> unique identifier</h3>
|
||||
<div class="outline-text-3" id="text-2-8">
|
||||
|
||||
|
||||
<p>
|
||||
This provides to a way to identify a snippet, independent of its name.
|
||||
Loading a second snippet file with the same uuid would replace the
|
||||
previous snippet.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="outline-container-2-9" class="outline-3">
|
||||
<h3 id="sec-2-9"><code># contributor:</code> snippet author</h3>
|
||||
<div class="outline-text-3" id="text-2-9">
|
||||
|
||||
|
||||
<p>
|
||||
This is optional and has no effect whatsoever on snippet functionality,
|
||||
but it looks nice.
|
||||
@@ -472,7 +507,7 @@ but it looks nice.
|
||||
</div>
|
||||
|
||||
<div id="outline-container-3" class="outline-2">
|
||||
<h2 id="sec-3">Template syntax</h2>
|
||||
<h2 id="sec-3"><span class="target">Template syntax</span></h2>
|
||||
<div class="outline-text-2" id="text-3">
|
||||
|
||||
|
||||
@@ -490,8 +525,8 @@ to TextMate's.
|
||||
|
||||
<p>
|
||||
Arbitrary text can be included as the content of a template. They are
|
||||
usually interpreted as plain text, except <code>$</code> and ==. You need to
|
||||
use \` to escape them: <code>\$</code> and <code>\</code>. The \` itself may also needed to be
|
||||
usually interpreted as plain text, except <code>$</code> and <code>`</code>. You need to
|
||||
use <code>\</code> to escape them: <code>\$</code> and <code>\`</code>. The <code>\</code> itself may also needed to be
|
||||
escaped as <code>\\</code> sometimes.
|
||||
</p>
|
||||
</div>
|
||||
@@ -505,7 +540,7 @@ escaped as <code>\\</code> sometimes.
|
||||
|
||||
<p>
|
||||
Emacs-Lisp code can be embedded inside the template, written inside
|
||||
back-quotes (==). The lisp forms are evaluated when the snippet is
|
||||
back-quotes (<code>`</code>). The lisp forms are evaluated when the snippet is
|
||||
being expanded. The evaluation is done in the same buffer as the
|
||||
snippet being expanded.
|
||||
</p>
|
||||
@@ -840,7 +875,7 @@ performs the normal Emacs <code>delete-char</code> command.
|
||||
</div>
|
||||
|
||||
<div id="postamble">
|
||||
<hr><p class='creator'>Generated by <a href="http://orgmode.org">Org</a> version 7.9.3f with <a href="http://www.gnu.org/software/emacs/">Emacs</a> version 24 on 2013-12-24T11:50-0500 from 78c8b5eb8058e8da523542b1b1de7e21a5b60e14
|
||||
<hr><p class='creator'>Generated by <a href="http://orgmode.org">Org</a> version 7.9.3f with <a href="http://www.gnu.org/software/emacs/">Emacs</a> version 24 on 2014-05-11T19:37-0400 from fe288a156c063666d9c6613b6eea0ed5a515a86b
|
||||
</p>
|
||||
<p class='xhtml-validation'><a href="http://validator.w3.org/check?uri=referer">Validate XHTML 1.0</a></p>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user