btv.snippet
btv.snippet.setup(opts)
btv.snippet.setup { jump_next = "<Tab>", jump_prev = "<S-Tab>" }
Configure the tabstop-jump keys. Either may be a string or a list of strings; an
omitted key keeps its default (<Tab> / <S-Tab>).
Defined in snippet.lua.
btv.snippet.add(ft, list)
btv.snippet.add("rust", { { trigger = "fn", body = "fn ${1:name}() {\n\t$0\n}" }, … })
Register snippets for a filetype. trigger and body are required strings.
Re-adding a trigger already registered for ft replaces that snippet’s body.
Function bodies (dynamic / context-aware) are not supported yet and error loud
rather than silently dropping the snippet (deferred to a later phase).
Defined in snippet.lua.
btv.snippet.expand(body)
btv.snippet.expand("for ${1:i} = 1, ${2:n} do\n\t$0\nend")
Expand a snippet body at the cursor immediately, entering Insert mode at the
first tabstop. Errors loud on a malformed / unsupported body.
Defined in snippet.lua.