Skip to content

Dynamic Snippets: The {{}} syntax

Osaka edited this page Feb 3, 2025 · 2 revisions

The {{}} syntax is used to dynamically insert the arguments of your snippet into a certain part of the body of your snippet.

Example

{
    ...
    Args = {
        ["foo"] = { default = 1 },
    },
    Body = {
        "foo is {{foo}}", -- It has to be the same name as the argument name.
    },
    ...
}
--@foo{foo=10}

-- Replacement:
foo is 10
Clone this wiki locally