Skip to main content

Module colorscheme

Module colorscheme 

Source
Expand description

Colorscheme setup. Colorscheme and highlight group configuration helpers.

Exposes a dictionary with a set function applying base UI preferences (dark background, termguicolors) and custom highlight groups (diagnostics, statusline, general UI).

ยงNote on set_hl implementation

Highlight options are set through a Lua-based path (vim.api.nvim_set_hl) instead of the direct C FFI binding (nvim_oxi::api::set_hl). This works around an ABI mismatch between nvim-oxiโ€™s SetHighlightOpts struct layout (targeting Neovim v0.11.3) and Neovim v0.12.0-dev (886efcb853), where the cterm field in Dict(highlight) changed from Object (32 bytes) to DictAs(highlight_cterm) / Dict (24 bytes), shifting all subsequent fields and causing validation errors.

Structsยง

LuaHlOpts ๐Ÿ”’
Highlight options that serialize to a Lua table literal for use with vim.api.nvim_set_hl().

Constantsยง

COMMENTS_FG ๐Ÿ”’
CURSOR_BG ๐Ÿ”’
CURSOR_FG ๐Ÿ”’
DIAGNOSTICS_FG ๐Ÿ”’
DIAG_ERROR_FG ๐Ÿ”’
DIAG_HINT_FG ๐Ÿ”’
DIAG_INFO_FG ๐Ÿ”’
DIAG_OK_FG ๐Ÿ”’
DIAG_WARN_FG ๐Ÿ”’
GITSIGNS_ADDED ๐Ÿ”’
GITSIGNS_CHANGED ๐Ÿ”’
GITSIGNS_FG ๐Ÿ”’
GITSIGNS_REMOVED ๐Ÿ”’
GLOBAL_BG ๐Ÿ”’
GLOBAL_FG ๐Ÿ”’
NONE ๐Ÿ”’
NON_TEXT_FG ๐Ÿ”’
TREESITTER_CONTEXT_BG ๐Ÿ”’

Functionsยง

decimal_to_hex_color ๐Ÿ”’
Formats an RGB integer as a #RRGGBB hex string.
dict
[Dictionary] with colorscheme and highlight helpers.
get_hl ๐Ÿ”’
Retrieves [GetHlInfos] (single or map) for given highlight options.
get_hl_multiple ๐Ÿ”’
Retrieves multiple [HighlightInfos] entries (map variant) for given highlight options.
get_hl_single ๐Ÿ”’
Retrieves [HighlightInfos] of a single group.
get_overridden_hl_opts ๐Ÿ”’
Retrieves the current highlight options for a given highlight group and applies overrides.
set
Sets the desired Neovim colorscheme and custom highlight groups.
set_hl ๐Ÿ”’
Sets a highlight group in the specified namespace via Lua, bypassing the broken C FFI path.