How can I use a snipmate variable in an expression?
snippet foo
${1:4} + 2 = `$1+2`
With the default value of 4 the above snippet produces:
4 + 2 = 2
Thanks.
At least in the original snipMate plugin, expressions are evaluated first, then tab stops. This allows you to define things like ${1:`v:version`}
, but it makes your use case impossible to achieve.
Have a look at UltiSnips; it is modern and powerful, and might allow this. There are more alternatives, see this list on the Vim Tips Wiki.