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

nx.match.add(group, pattern, priority, id, opts)

nx.match.add(group, pattern[, priority[, id[, opts]]]) -> id [alias vim.fn.matchadd]: register a request to highlight every match of the regex pattern with highlight group group in a window. priority orders overlapping matches (default 10); id requests a specific match id (nil / -1 auto-allocates a fresh one); opts.window targets a window other than the current one. Returns the match id.

CAVEAT: the registry is faithful — ids are allocated and stored, and nx.match.get reflects them — but nxvim does NOT yet render these matches (there is no :match / matchadd decoration path in the core). The highlight is recorded but not painted, and the call succeeds rather than failing loud. (A previewer that uses it to tint a search term shows correct content, just un-tinted for now.)

Defined in vimfn.lua.

nx.match.addpos(group, pos, priority, id, opts)

nx.match.addpos(group, pos[, priority[, id[, opts]]]) -> id [alias vim.fn.matchaddpos]: like nx.match.add, but highlights explicit positions instead of a regex. pos is a list whose items are a line number, {lnum}, or {lnum, col, len} (1-based). Same id / priority / opts.window handling — and the same not-yet-rendered caveat as nx.match.add.

Defined in vimfn.lua.

nx.match.delete(id, win)

nx.match.delete(id[, win]) -> 0 | -1 [alias vim.fn.matchdelete]: remove the match with id id from window win (0/nil = current). Returns 0 if it existed, else -1.

Defined in vimfn.lua.

nx.match.clear(win)

nx.match.clear([win]) -> 0 [alias vim.fn.clearmatches]: remove every match from window win (0/nil = current).

Defined in vimfn.lua.

nx.match.get(win)

nx.match.get([win]) -> list [alias vim.fn.getmatches]: the registered matches of window win (0/nil = current), id-ascending. Each entry is { group, id, priority, pattern? | pos? } — the pattern form from nx.match.add, the pos form from nx.match.addpos.

Defined in vimfn.lua.