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