-
Notifications
You must be signed in to change notification settings - Fork 78
Open
Labels
enhancementNew feature or requestNew feature or request
Description
The suggested snippet by G. Castel
s({
trig = "([%a])_(%d%d)",
name = "auto subscript 2",
}, {
f(function(_, snip)
return string.format("%s_{%s}", snip.captures[1], snip.captures[2])
end, {}),
i(0),
}),
does not work when using letters in indices such as a_ij
and is constrained that only a single leading letter is allowed, e.g. when using greek letters \alpha_12
, the snippet is also not triggered.
My snippet definition looks like
s({
trig = "_(%w%w)",
name = "auto subscript 3",
regTrig=true,
wordTrig=false,
snippetType="autosnippet",
}, {
f(function(_, snip)
return string.format("_{%s", snip.captures[1])
end, {}),
i(1),
t("}"),
i(0),
}, {condition = is_math}),
It is not yet battle tested. If there is a good reason why this is a bad idea, I am happy to hear it.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request