-
Notifications
You must be signed in to change notification settings - Fork 0
API
Load the module with:
local neotheme = require("neotheme")Validates configuration, resolves the selected built-in or custom palette, stores the resolved state, and returns the Neotheme module.
require("neotheme").setup({
theme = "gruber-dark",
bold = false,
})setup does not apply highlights by itself. Load colorscheme neotheme after setup.
See Configuration for the complete option schema.
Returns a deep copy of the currently resolved semantic palette:
local palette = require("neotheme").palette()
print(palette.surface.base)If no palette has been resolved yet, palette() resolves the current configuration first. Mutating the returned table does not alter Neotheme state.
Use configure_palette during setup when a change must affect highlights.
Returns a sorted copy of the available theme names:
local names = require("neotheme").themes()
print(vim.inspect(names))The list contains:
custom
gruber-dark
gruber-dark-muted
gruber-darker
gruber-light
gruber-light-muted
gruber-lighter
Mutating the returned list does not alter the internal registry.
Applies the resolved palette and configuration. The file colors/neotheme.lua calls this function, so normal use should prefer:
vim.cmd.colorscheme("neotheme")load() performs these operations:
- Requires Neovim 0.12 or newer.
- Sets
backgroundfrom the selected theme. - Clears existing highlights when another colorscheme is active.
- Enables
termguicolors. - Sets
vim.g.colors_nametoneotheme. - Applies core, Tree-sitter, LSP, terminal, and enabled integration highlights.
- Invalidates Neotheme's cached Lualine modules.
- Recreates Neotheme's colorscheme and sidebar autocmds.
The normal lifecycle is:
setup options -> resolve palette -> load colorscheme -> apply highlights
Calling setup again replaces the resolved configuration and palette. Reload the colorscheme to apply that state.
Neotheme raises errors for:
- Unsupported Neovim versions during
load - Unknown option keys
- Incorrect option types
- Unknown theme names
- Unknown palette categories or fields
- Invalid palette color values
- A non-
nilreturn fromconfigure_palette
Neotheme emits a warning, rather than an error, when a resolved palette is missing semantic roles. The warning lists all missing paths.
See Troubleshooting for fixes and Palette Customization for palette rules.
See Architecture for module boundaries, copy isolation, and the full resolution pipeline.