Reference

Table of Contents

Interactive functions

yas-load-snippet-buffer-and-close (table &optional kill)

Load and save the snippet, then quit-window if saved. Loading is performed by yas-load-snippet-buffer. If the snippet is new, ask the user whether (and where) to save it. If the snippet already has a file, just save it.

The prefix argument kill is passed to quit-window.

Don't use this from a Lisp program, call yas-load-snippet-buffer and kill-buffer instead.

yas-load-directory (top-level-dir &optional use-jit interactive)

Load snippets in directory hierarchy top-level-dir.

Below top-level-dir each directory should be a mode name.

With prefix argument use-jit do jit-loading of snippets.

yas-describe-table-by-namehash ()

Display snippet tables by namehash.

yas-tryout-snippet (&optional debug)

Test current buffer's snippet template in other buffer. debug is for debugging the YASnippet engine itself.

Customization variables

yas-expand-only-for-last-commands

List of last-command values to restrict tab-triggering to, or nil.

Leave this set at nil (the default) to be able to trigger an expansion simply by placing the cursor after a valid tab trigger, using whichever commands.

Optionally, set this to something like (self-insert-command) if you to wish restrict expansion to only happen when the last letter of the snippet tab trigger was typed immediately before the trigger key itself.

yas-wrap-around-region

What to insert for snippet's $0 field.

If set to a character, insert contents of corresponding register. If non-nil insert region contents. This can be overridden on a per-snippet basis. A value of cua is considered equivalent to `?0' for backwards compatibility.

yas-new-snippet-default

Default snippet to use when creating a new snippet. If nil, don't use any snippet.

Validate