Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

nx.snippet

nx.snippet.setup(opts)

nx.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.

nx.snippet.add(ft, list)

nx.snippet.add(“rust”, { { trigger = “fn”, body = “fn ${1:name}() {\n\t$0\n}” }, … }) Register snippets for a filetype. trigger and body are required strings. 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.

nx.snippet.expand(body)

nx.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.