SirVer / ultisnips

UltiSnips - The ultimate snippet solution for Vim. Send pull requests to SirVer/ultisnips!
GNU General Public License v3.0
7.55k stars 691 forks source link

multi-word triggers #1530

Closed aloispichler closed 1 year ago

aloispichler commented 1 year ago

This is rather a question, which I could not figure out based on the docs. Suppose the snippet (in an example from LaTeX) is \includegraphics. I'd like to expand the snipped upon typing \includeg', or 'includegraphics or any word in between. How can that be accomplished with Ultisnips?

SirVer commented 1 year ago

You need to use a regular expression trigger that matches the partial trigger word for the moment. There was a feature request for this, but I could not find it right now.

aloispichler commented 1 year ago

Would you mind sharing the regular expression which does the job?

SirVer commented 1 year ago

This one maybe:

snippet "\\includegr.*" "Description" r
\includegraphics{
endsnippet