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

btv.tbl

btv.tbl.is_empty(t)

btv.tbl.is_empty(t) [alias vim.tbl_isempty]: does t have no entries?

Defined in stdlib.lua.

btv.tbl.contains(t, value)

btv.tbl.contains(t, value) [alias vim.tbl_contains]: is value one of t’s values?

Defined in stdlib.lua.

btv.tbl.keys(t)

btv.tbl.keys(t) [alias vim.tbl_keys]: a list of t’s keys.

Defined in stdlib.lua.

btv.tbl.values(t)

btv.tbl.values(t) [alias vim.tbl_values]: a list of t’s values.

Defined in stdlib.lua.

btv.tbl.count(t)

btv.tbl.count(t) [alias vim.tbl_count]: number of entries in t (any keys, not just the sequence).

Defined in stdlib.lua.

btv.tbl.deep_equal(a, b)

btv.tbl.deep_equal(a, b) [alias vim.deep_equal]: structural equality (recurses into tables, comparing keys and values). A general config/plugin helper.

Defined in stdlib.lua.

btv.tbl.get(o, ...)

btv.tbl.get(o, ...) [alias vim.tbl_get]: follow the ... keys into nested table o, returning the value reached or nil if any step is missing (or hits a non-table before the last key). The safe nested access lsp/<server>.lua configs use to read deep settings (e.g. rust_analyzer’s settings['rust-analyzer'].cargo.sysrootSrc).

Defined in stdlib.lua.

btv.tbl.filter(f, t)

btv.tbl.filter(f, t) [alias vim.tbl_filter]: Iterates with pairs (not ipairs) to match neovim: callers filter name-keyed maps too (a plugin manager filters its plugin set, keyed by plugin name), not just arrays. The result is always a fresh array.

Defined in stdlib.lua.

btv.tbl.map(f, t)

btv.tbl.map(f, t) [alias vim.tbl_map]: apply f to each value, keeping keys.

Defined in stdlib.lua.

btv.tbl.flatten(t)

btv.tbl.flatten(t) [alias vim.tbl_flatten]: a single list with every nested list flattened into it (depth-first). Deprecated in neovim but still called by lspconfig.util.

Defined in stdlib.lua.

btv.tbl.deepcopy(orig)

btv.tbl.deepcopy(orig) [alias vim.deepcopy]: a recursive copy of orig (metatables preserved).

Defined in stdlib.lua.

btv.tbl.deep_extend(behavior, ...)

btv.tbl.deep_extend(behavior, ...) [alias vim.tbl_deep_extend]: Merge ... maps into one. behavior is "force" | "keep" | "error". Nested maps merge recursively; lists are replaced whole; scalar conflicts resolve per behavior.

The list rule is neovim’s, and it is load-bearing rather than cosmetic: merging a list index-by-index fuses two unrelated entries and leaves a stale tail, so a re-registered tool list (btv.lsp.config’s settings.languages.<ft>) would keep the dropped tool’s keys on entry 1 and its old entry 2 — a config nobody wrote.

The JSON sentinels are values, not maps: btv.json.null and btv.json.empty_object() REPLACE whatever they are merged over (and are replaced by a later real value), so “explicitly nothing” written over a preset’s table means what it says.

Defined in stdlib.lua.

btv.tbl.extend(behavior, ...)

btv.tbl.extend(behavior, ...) [alias vim.tbl_extend]: Shallow variant of btv.tbl.deep_extend.

Defined in stdlib.lua.

btv.tbl.spairs(t)

btv.tbl.spairs(t) [alias vim.spairs]: pairs() in sorted-key order. Neovim’s stable-iteration helper — a custom 'tabline'/str_join uses it so output order is deterministic.

Defined in stdlib.lua.