ultisnips
ultisnips copied to clipboard
Expand output of interpolation
I would like to create a snippet to make a choice from a list of options. As UltiSnips supports
choices via the ${1|<choice-1>,...,<choice-n>|}
syntax I was wondering if there is any way to use shell code interpolation to generate the choice syntax.
When I use the following snippet
snippet fontnames_snippet "Snippet for fontnames"
${1|`cat /tmp/fontnames.txt | sort | uniq | awk 'NF' | paste -sd ','`|}
endsnippet
UltiSnips expands to the following:
${1|Adobe Courier Bold,...,STIXMathJax_Variants-Regular|}
where I would actually like to expand this again to get the desired menu of choices. Is there a way to achieve this with UltiSnips?