]> code.delx.au - gnu-emacs-elpa/blob - doc/snippet-menu.org
cf5dec58795ac849aa3ea8112c60cb37da215e5f
[gnu-emacs-elpa] / doc / snippet-menu.org
1 * YASnippet menu
2
3 When =yas-minor-mode= is active, YASnippet will setup a menu just after
4 the "Buffers" menu in the menubar.
5
6 In this menu, you can find
7
8 - The currently loaded snippet definitions, organized by major mode,
9 and optional grouping.
10
11 - A rundown of the most common commands, (followed by their
12 keybindings) including commands to load directories and reload all
13 snippet definitions.
14
15 - A series of submenus for customizing and exploring YASnippet
16 behavior.
17
18 [[images/menu-1.png]]
19
20 ** Loading snippets from menu
21
22 Invoking "Load snippets..." from the menu invokes =yas-load-directory=
23 and prompts you for a snippet directory hierarchy to load.
24
25 Also useful is the "Reload all" options which uncondionally reloads all
26 the snippets directories defined in =yas-root-directory= and rebuilds
27 the menus.
28
29 ** Snippet menu behavior
30
31 YASnippet will list in this section all the loaded snippet definitions
32 organized by snippet table name.
33
34 You can use this section to explore currently loaded snippets. If you
35 click on one of them, the default behavior is to expand it,
36 unconditionally, inside the current buffer.
37
38 You can however, customize variable =yas-visit-from-menu= to be =t=
39 which will take you to the snippet definition file when you select it
40 from the menu.
41
42 If you want the menu show only snippet tables whose name corresponds to
43 a "real" major mode. You do this by setting =yas-use-menu= to
44 ='real-modes=.
45
46 Finally, to have the menu show only the tables for the currently active
47 mode, set =yas-use-menu= to =abbreviate=.
48
49 These customizations can also be found in the menu itself, under the
50 "Snippet menu behavior" submenu.
51
52 ** Controlling indenting
53
54 The "Indenting" submenu contains options to control the values of
55 =yas-indent-line= and =yas-also-auto-indent-first-line=. See
56 [[snippet-development.html][Writing snippets]] .
57
58 ** Prompting method
59
60 The "Prompting method" submenu contains options to control the value of
61 =yas-prompt-functions=. See [[snippet-expansion.html][Expanding
62 snippets]] .
63
64 ** Misc
65
66 The "Misc" submenu contains options to control the values of more
67 variables.