summaryrefslogblamecommitdiffstats
path: root/emacs.d/lisp/yasnippet/doc/snippet-menu.html
blob: ad9811b6191d74fcf06bf2d3377ac8f52b7bcc55 (plain) (tree)












































































































































                                                                                                                                                                                
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils 0.6: http://docutils.sourceforge.net/" />
<title>YASnippet menu</title>
<link rel="stylesheet" href="styles.css" type="text/css" />
</head>
<body>
<div class="document" id="yasnippet-menu">
<div id="header-region" class="clear-block"></div>
<div id="wrapper">
  <div id="container" class="clear-block">
    <div id="header">
    <div id="logo-floater">
    <h1 class="title">YASnippet menu</h1>
    </div>
    <ul class="primary-links">
      <li>
        <a title="" href="index.html">Intro and tutorial</a>
      </li>
      <li>
        <a title="" href="snippet-organization.html">Howto: organize</a>
      </li>
      <li>
        <a title="" href="snippet-expansion.html">Howto: expand</a>
      </li>
      <li>
        <a title="" href="snippet-development.html">Howto: write </a>
      </li>
      <li>
        <a title="" href="snippet-menu.html">Howto: menu </a>
      </li>
      <li>
        <a title="" href="faq.html">FAQ</a>
      </li>
      <li>
        <a title="" href="changelog.html">ChangeLog</a>
      </li>
      <li>
        <a title="" href="http://code.google.com/p/yasnippet/downloads/list">Download</a>
      </li>
    </ul>
    </div>
    <div id="center">
      <div id="squeeze">
        <div class="right-corner">
          <div class="left-corner">
            <p>
              <b>Important:</b> This documentation applies to
              the <b>SVN trunk</b> of YASnippet, which you
              get <a href="http://code.google.com/p/yasnippet/source/checkout">here</a>. Documentation
              for other versions can be found <a title=""
              href="http://code.google.com/p/yasnippet/downloads/list">here</a>.
            </p>
            <div class="contents topic" id="contents">
<p class="topic-title first">Contents</p>
<ul class="simple">
<li><a class="reference internal" href="#loading-snippets-from-menu" id="id1">Loading snippets from menu</a></li>
<li><a class="reference internal" href="#snippet-menu-behavior" id="id2">Snippet menu behavior</a></li>
<li><a class="reference internal" href="#controlling-indenting" id="id3">Controlling indenting</a></li>
<li><a class="reference internal" href="#prompting-method" id="id4">Prompting method</a></li>
<li><a class="reference internal" href="#misc" id="id5">Misc</a></li>
</ul>
</div>
<p>When <tt class="docutils literal"><span class="pre">yas/minor-mode</span></tt> is active, YASnippet will setup a menu just
after the &quot;Buffers&quot; menu in the menubar.</p>
<p>In this menu, you can find</p>
<ul class="simple">
<li>The currently loaded snippet definitions, organized by major mode,
and optional grouping.</li>
<li>A rundown of the most common commands, (followed by their
keybindings) including commands to load directories and reload all
snippet definitions.</li>
<li>A series of submenus for customizing and exploring YASnippet
behavior.</li>
</ul>
<img align="right" alt="images/menu-1.png" class="align-right" src="images/menu-1.png" />
<div class="section" id="loading-snippets-from-menu">
<h1><a class="toc-backref" href="#id1">Loading snippets from menu</a></h1>
<p>Invoking &quot;Load snippets...&quot; from the menu invokes
<tt class="docutils literal"><span class="pre">yas/load-directory</span></tt> and prompts you for a snippet directory
hierarchy to load.</p>
<p>Also useful is the &quot;Reload all&quot; options which uncondionally reloads
all the snippets directories defined in <tt class="docutils literal"><span class="pre">yas/root-directory</span></tt> and
rebuilds the menus.</p>
</div>
<div class="section" id="snippet-menu-behavior">
<h1><a class="toc-backref" href="#id2">Snippet menu behavior</a></h1>
<p>YASnippet will list in this section all the loaded snippet definitions
organized by snippet table name.</p>
<p>You can use this section to explore currently loaded snippets. If you
click on one of them, the default behavior is to expand it,
unconditionally, inside the current buffer.</p>
<p>You can however, customize variable <tt class="docutils literal"><span class="pre">yas/visit-from-menu</span></tt> to be
<tt class="docutils literal"><span class="pre">t</span></tt> which will take you to the snippet definition file when you
select it from the menu.</p>
<p>If you want the menu show only snippet tables whose name corresponds
to a &quot;real&quot; major mode. You do this by setting <tt class="docutils literal"><span class="pre">yas/use-menu</span></tt> to
<tt class="docutils literal"><span class="pre">'real-modes</span></tt>.</p>
<p>Finally, to have the menu show only the tables for the currently
active mode, set <tt class="docutils literal"><span class="pre">yas/use-menu</span></tt> to <tt class="docutils literal"><span class="pre">abbreviate</span></tt>.</p>
<p>These customizations can also be found in the menu itself, under the
&quot;Snippet menu behavior&quot; submenu.</p>
</div>
<div class="section" id="controlling-indenting">
<h1><a class="toc-backref" href="#id3">Controlling indenting</a></h1>
<p>The &quot;Indenting&quot; submenu contains options to control the values of
<tt class="docutils literal"><span class="pre">yas/indent-line</span></tt> and <tt class="docutils literal"><span class="pre">yas/also-auto-indent-first-line</span></tt>. See
<a class="reference external" href="snippet-development.html">Writing snippets</a> .</p>
</div>
<div class="section" id="prompting-method">
<h1><a class="toc-backref" href="#id4">Prompting method</a></h1>
<p>The &quot;Prompting method&quot; submenu contains options to control the value
of <tt class="docutils literal"><span class="pre">yas/prompt-functions</span></tt>. See <a class="reference external" href="snippet-expansion.html">Expanding snippets</a> .</p>
</div>
<div class="section" id="misc">
<h1><a class="toc-backref" href="#id5">Misc</a></h1>
<p>The &quot;Misc&quot; submenu contains options to control the values of more
variables.</p>
</div>
	  </div>
	</div>
      </div>
    </div>
  </div>
</div>
<script type="text/javascript">
  var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
  document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
  try {
  var pageTracker = _gat._getTracker("UA-10536822-1");
  pageTracker._trackPageview();
  } catch(err) {}
</script>
</div>
</body>
</html>