You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What I am trying to achieve is that I have a template that can either be expanded by typing a complete mnemonic shortcut (say ascn for assert.className), or to just type a common root to get a list of suggestions (say as to get a list of all assertions).
The simplest way of fixing that in my mind would be to allow multiple keys. But as I can tell from the yasnippet source code, it might be an extensive job to make that happen.
So, do you have any suggestions on how to do it? Maybe I should programmatically create the snippets instead, and register two snippets per template?
The text was updated successfully, but these errors were encountered:
I'll try to analyse this issue more carefully, but it also springs to mind that you can make a ascn snippet expand to assert.classname. Hitting the trigger key twice in a row would give you the desired behaviour. You can also make ascn be a snippet-command consisting of elisp that inserts that text then calls yas-expand automatically. Snippet-commands are the ones using # type: command, unfortunately very undocumented except for informal issue replies and emails to the list.
As for the as suggestion, maybe you can use auto-complete, which is a completion framework. Yasnippet is a template expansion framework, with some menus to resolve ambiguity, some of which operate through completion backends like ido-completing-read. I agree that in this last part there is some overlap.
Anyway, I will try to analyse your request, time permitting. Patches and bold redesign attempts are welcome though.
The simplest way of fixing that in my mind would be to allow multiple keys. But as I can tell from the yasnippet source code, it might be an extensive job to make that happen.
Good day,
What I am trying to achieve is that I have a template that can either be expanded by typing a complete mnemonic shortcut (say
ascn
forassert.className
), or to just type a common root to get a list of suggestions (sayas
to get a list of all assertions).The simplest way of fixing that in my mind would be to allow multiple keys. But as I can tell from the yasnippet source code, it might be an extensive job to make that happen.
So, do you have any suggestions on how to do it? Maybe I should programmatically create the snippets instead, and register two snippets per template?
The text was updated successfully, but these errors were encountered: