]> code.delx.au - gnu-emacs-elpa/blob - doc/snippet-menu.html
* proof-reading the documentation
[gnu-emacs-elpa] / doc / snippet-menu.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>YASnippet menu</title>
8 <link rel="stylesheet" href="styles.css" type="text/css" />
9 </head>
10 <body>
11 <div class="document" id="yasnippet-menu">
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">YASnippet menu</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="#loading-snippets-from-menu" id="id1">Loading snippets from menu</a></li>
61 <li><a class="reference internal" href="#snippet-menu-behavior" id="id2">Snippet menu behavior</a></li>
62 <li><a class="reference internal" href="#controlling-indenting" id="id3">Controlling indenting</a></li>
63 <li><a class="reference internal" href="#prompting-method" id="id4">Prompting method</a></li>
64 <li><a class="reference internal" href="#misc" id="id5">Misc</a></li>
65 </ul>
66 </div>
67 <p>When <tt class="docutils literal"><span class="pre">yas/minor-mode</span></tt> is active, YASnippet will setup a menu just
68 after the &quot;Buffers&quot; menu in the menubar.</p>
69 <p>In this menu, you can find</p>
70 <ul class="simple">
71 <li>The currently loaded snippet definitions, organized by major mode,
72 and optional grouping.</li>
73 <li>A rundown of the most common commands, (followed by their
74 keybindings) including commands to load directories and reload all
75 snippet definitions.</li>
76 <li>A series of submenus for customizing and exploring YASnippet
77 behavior.</li>
78 </ul>
79 <img align="right" alt="images/menu-1.png" class="align-right" src="images/menu-1.png" />
80 <div class="section" id="loading-snippets-from-menu">
81 <h1><a class="toc-backref" href="#id1">Loading snippets from menu</a></h1>
82 <p>Invoking &quot;Load snippets...&quot; from the menu invokes
83 <tt class="docutils literal"><span class="pre">yas/load-directory</span></tt> and prompts you for a snippet directory
84 hierarchy to load.</p>
85 <p>Also useful is the &quot;Reload all&quot; options which uncondionally reloads
86 all the snippets directories defined in <tt class="docutils literal"><span class="pre">yas/root-directory</span></tt> and
87 rebuilds the menus.</p>
88 </div>
89 <div class="section" id="snippet-menu-behavior">
90 <h1><a class="toc-backref" href="#id2">Snippet menu behavior</a></h1>
91 <p>YASnippet will list in this section all the loaded snippet definitions
92 organized by snippet table name.</p>
93 <p>You can use this section to explore currently loaded snippets. If you
94 click on one of them, the default behavior is to expand it,
95 unconditionally, inside the current buffer.</p>
96 <p>You can however, customize variable <tt class="docutils literal"><span class="pre">yas/visit-from-menu</span></tt> to be
97 <tt class="docutils literal"><span class="pre">t</span></tt> which will take you to the snippet definition file when you
98 select it from the menu.</p>
99 <p>If you want the menu show only snippet tables whose name corresponds
100 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
101 <tt class="docutils literal"><span class="pre">'real-modes</span></tt>.</p>
102 <p>Finally, to have the menu show only the tables for the currently
103 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>
104 <p>These customizations can also be found in the menu itself, under the
105 &quot;Snippet menu behavior&quot; submenu.</p>
106 </div>
107 <div class="section" id="controlling-indenting">
108 <h1><a class="toc-backref" href="#id3">Controlling indenting</a></h1>
109 <p>The &quot;Indenting&quot; submenu contains options to control the values of
110 <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
111 <a class="reference external" href="snippet-development.html">Writing snippets</a> .</p>
112 </div>
113 <div class="section" id="prompting-method">
114 <h1><a class="toc-backref" href="#id4">Prompting method</a></h1>
115 <p>The &quot;Prompting method&quot; submenu contains options to control the value
116 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>
117 </div>
118 <div class="section" id="misc">
119 <h1><a class="toc-backref" href="#id5">Misc</a></h1>
120 <p>The &quot;Misc&quot; submenu contains options to control the values of more
121 variables.</p>
122 </div>
123 </div>
124 </div>
125 </div>
126 </div>
127 </div>
128 </div>
129 <script type="text/javascript">
130 var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
131 document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
132 </script>
133 <script type="text/javascript">
134 try {
135 var pageTracker = _gat._getTracker("UA-10536822-1");
136 pageTracker._trackPageview();
137 } catch(err) {}
138 </script>
139 </div>
140 </body>
141 </html>