How can I expand a fragment of a fragment using YASnippet?

On YASnippet, I noticed the following description of yas/triggers-in-field :

If non-nil, yas/next-field-key can trigger stack extensions, that is, a fragment extension inside another fragment extension. Otherwise, yas/next-field-key simply trying to move on to the next field.

I don’t understand how to do this.

I assumed that after I installed: #expand-env: ((yas/triggers-in-field #t)) , whenever I type an abbreviation into a field and press Tab , it expands, however this is not .

+7
source share
1 answer

yas/triggers-in-field is a variable. The default value is nil.

His document states:

If non-nil, `yas / next-field-key 'can trigger stack decompositions.

Otherwise, `yas / next-field-key 'just tries to move on to the next field

Thus, to enable stack extensions, you must set the variable to a value other than zero, for example t . If you want this parameter to be constant, enter the following in your .emacs:

 (setq yas/triggers-in-field t); Enable nested triggering of snippets 

You can read about other custom YASnippet variables at http://capitaomorte.github.com/yasnippet/snippet-development.html#customizable-variables

+8
source

All Articles