Timeline for How to use a Template for creating YaSnippet snippets
Current License: CC BY-SA 4.0
7 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Aug 17, 2022 at 18:58 | comment | added | lawlist | Yes, I like your idea of a list. Happy coding ...! | |
Aug 17, 2022 at 18:55 | vote | accept | Sinthoras | ||
Aug 17, 2022 at 18:54 | comment | added | Sinthoras | That is a good idea. It would probably be better to have one variable, which is a list, rather than multiple variables, wouldn't it? I will try that, (and on the way learn some more elisp) thank you! | |
Aug 17, 2022 at 17:55 | comment | added | lawlist |
You can create a custom function that asks for input, and/or accepts arguments, and/or accepts a universal argument, and let -bind various templates .... once the template has been chosen, yas-new-snippet-default can be let -bound to the selected template and then the function yas-new-snippet can be called and it will assume the chosen template is the one to use. You can also create multiple different variables for templates and the custom function can use them; e.g., template-one--var , template-two--var , etc. That would be a new question and would require a new thread.
|
|
Aug 17, 2022 at 17:40 | comment | added | Sinthoras | Thank you! This worked :-) Do you know of a possibility to define multiple such templates, or is it only possible to change the default? | |
Aug 17, 2022 at 15:50 | history | edited | lawlist | CC BY-SA 4.0 |
added 61 characters in body
|
Aug 17, 2022 at 15:43 | history | answered | lawlist | CC BY-SA 4.0 |