Theme workbench
j/k, preview with EnterPREVIEW → APPLIED → SAVED status badgeColor tuning
parameter, property, method, interface, enumMember, readonly, deprecated, … their own color (palette key or hex) and bold / italic / underline / strikethrough, previewed liveReadability doctor
Output
colors/<name>.lua that works with :colorschemeterminal_color_0..15 and refreshes lualine automaticallyhttps://github.com/user-attachments/assets/e14748e9-213f-4f9e-8297-e66412f68102
The video walks through every feature: help, live preview, favorites, search, surprise theme, blend sliders with undo, UI toggles, custom hex colors, custom LSP semantic tokens, Apply → Save to config, the doctor, blends, profiles and export.
| Step | Key | What happens | Status bar |
|---|---|---|---|
| Preview | Enter, sliders, toggles |
The whole editor changes live, nothing is kept yet | PREVIEW |
| Apply | a or ✔ Apply theme |
Becomes the active theme and is restored on the next start | APPLIED |
| Save | s or ⤓ Save to config |
Writes a managed require("themeforge").apply({...}) block into your config |
SAVED |
| Export | e or ⇪ Export colorscheme |
Writes a standalone colors/<name>.lua |
Closing the panel with q without applying restores the previous theme.
termguicolors)Tagged releases are packaged automatically by GitHub Actions. The main branch
contains the latest development version.
-- lua/plugins/themeforge.lua
return {
"j4flmao/themeforge_nvim",
lazy = false,
priority = 1000,
config = function()
require("themeforge").setup({
default_theme = "tokyonight-storm",
})
end,
}
use({
"j4flmao/themeforge_nvim",
config = function()
require("themeforge").setup({ default_theme = "tokyonight-storm" })
end,
})
git clone https://github.com/j4flmao/themeforge_nvim \
~/.local/share/nvim/site/pack/vendor/start/themeforge_nvim
Then add to your init.lua:
require("themeforge").setup({ default_theme = "tokyonight-storm" })
:ThemeForge
The panel has three panes. Move between them with Tab / S-Tab:
| Pane | What it is for |
|---|---|
| Themes (left) | Favorites, recent themes and the full list, each with a palette swatch |
| Preview (middle) | Code samples (including LSP tokens) drawn with the current settings |
| Controls (right) | Actions, readability, blend sliders, UI options, colors, LSP tokens, plugins |
The bar at the bottom shows the status (PREVIEW / APPLIED / SAVED) and the main keys.
Press ? for every shortcut, q to close.
j / k move, Enter previews the theme over your whole editor./ searches by name or mood tag (calm, warm, high-contrast…), n picks a surprise theme.f adds the theme under the cursor to Favorites.Nothing is kept until you apply: closing with q restores the previous theme.
In the Controls pane (]] / [[ jump between its sections):
h / l (±5), H / L (±10), 0 resets. Tint toward a hue, warm it up,
change saturation or brightness. The background is protected and text never loses contrast.Enter toggles italic keywords, bold functions, transparency, cursorline…Enter on a row, type a hex code (#ff79c6), or clear to reset it.u / Ctrl-r undo and redo any change.| Key | Result |
|---|---|
a |
Apply: makes it your active theme, restored on the next start |
s |
Save to config: writes a require("themeforge").apply({...}) block into a config file you choose |
e |
Export: writes colors/<name>.lua, a standalone scheme for :colorscheme <name> |
b / p |
Save / load a named blend to reuse later |
P |
Apply a quick profile (focus, high-contrast, low-distraction, monochrome) |
Press d (or run :ThemeForge doctor). It reports:
vim.keymap.set("n", "<leader>Tt", "<cmd>ThemeForge<cr>", { desc = "ThemeForge: open" })
vim.keymap.set("n", "<leader>Tk", "<cmd>ThemeForge token<cr>", { desc = "ThemeForge: style LSP token under cursor" })
vim.keymap.set("n", "<leader>Td", "<cmd>ThemeForge doctor<cr>", { desc = "ThemeForge: doctor" })
vim.keymap.set("n", "<leader>Ts", "<cmd>ThemeForge save<cr>", { desc = "ThemeForge: save to config" })
| Problem | Fix |
|---|---|
| Colors look wrong or washed out | Your terminal needs true color: vim.o.termguicolors = true |
| My theme is gone after restart | You previewed but did not apply: press a (or s to save it in your config) |
| An LSP token color does not change | Run :ThemeForge doctor; if it says OVERRIDDEN, put the cursor on that word and run :ThemeForge token to style the exact group |
| No LSP TOKENS marked ● | The server sends no semantic tokens (pyright) or they are off (gopls: semanticTokens = true) |
| A plugin keeps old colors | :ThemeForge compat all, or check the PLUGINS list in the panel |
| Command | Description |
|---|---|
:ThemeForge / :ThemeForge open |
Open the theme panel |
:ThemeForge close |
Close the panel |
:ThemeForge apply [theme] |
Apply a theme directly |
:ThemeForge save [file] |
Save the configuration to a file |
:ThemeForge copy |
Copy the configuration to the clipboard |
:ThemeForge export [name] |
Write a standalone colors/<name>.lua |
:ThemeForge token |
Style the LSP semantic token under the cursor |
:ThemeForge reset |
Reset all overrides |
:ThemeForge list |
List bundled themes |
:ThemeForge status |
Show the active theme |
:ThemeForge save-blend [name] |
Save the current palette blend |
:ThemeForge load-blend [name] |
Load a saved blend |
:ThemeForge list-blends |
List saved blends |
:ThemeForge profile [name] |
Apply a built-in profile |
:ThemeForge random |
Apply a random theme |
:ThemeForge compat [auto|all|none] |
Set the plugin compatibility mode |
:ThemeForge doctor |
Contrast, color-blind safety, broken links, integrations |
Inside the panel:
| Key | Action |
|---|---|
Tab / S-Tab |
Next / previous pane |
j / k |
Move (theme list skips headers) |
Enter |
Preview theme, toggle option, edit color, press button |
Space |
Toggle option |
h / l |
Slider −5 / +5 |
H / L |
Slider −10 / +10 |
0 |
Reset slider |
B / I / U / S |
LSP token: toggle bold / italic / underline / strikethrough |
X |
LSP token: reset to the theme default |
]] / [[ |
Jump to the next / previous section (e.g. straight to LSP TOKENS) |
a |
Apply theme |
s |
Save to config |
e |
Export colorscheme |
d |
Run the doctor |
u / Ctrl-r |
Undo / redo |
r |
Reset overrides |
/ |
Search themes |
f |
Toggle favorite |
n |
Surprise theme |
b / p |
Save / load a blend |
P |
Apply a profile |
y |
Copy configuration |
i |
Show theme details |
c |
Cycle plugin compatibility mode |
? |
Help |
q / Esc |
Close the panel |
Defaults:
require("themeforge").setup({
default_theme = "tokyonight-storm",
restore_on_start = true,
compat = "auto", -- "auto" | "all" | "none" | { "telescope", ... }
export_dir = nil, -- defaults to stdpath("config") .. "/colors"
panel = {
width_ratio = 0.82,
height_ratio = 0.82,
border = "rounded",
},
ui = {
transparency = false,
italic_keywords = false,
bold_functions = false,
cursorline = true,
underline_diag = true,
bold_cursor = true,
signcolumn = "yes", -- "yes" | "number" | "no"
statusline = "full", -- "minimal" | "full" | "arrow"
},
})
| Option | Type | Default | Description |
|---|---|---|---|
default_theme |
string | "tokyonight-storm" |
Theme used on first start |
restore_on_start |
boolean | true |
Restore the last applied theme |
compat |
string | table | "auto" |
Plugin integrations to theme |
export_dir |
string | stdpath("config")/colors |
Where :ThemeForge export writes |
panel.width_ratio |
number | 0.82 |
Panel width (0–1) |
panel.height_ratio |
number | 0.82 |
Panel height (0–1) |
panel.border |
string | "rounded" |
Border style |
ui.transparency |
boolean | false |
Transparent backgrounds |
ui.italic_keywords |
boolean | false |
Italic keywords |
ui.bold_functions |
boolean | false |
Bold functions |
ui.cursorline |
boolean | true |
Highlight the cursor line |
ui.underline_diag |
boolean | true |
Underline diagnostics |
ui.bold_cursor |
boolean | true |
Bold cursor line and selection |
ui.signcolumn |
string | "yes" |
Signcolumn style |
ui.statusline |
string | "full" |
Statusline style |
Ready-to-copy configurations live in presets/:
focus.lua, high-contrast.lua
and monochrome.lua.
Language servers tag code with semantic tokens (@lsp.type.parameter,
@lsp.type.property, @lsp.mod.readonly, …). ThemeForge lets you style them on
top of any theme.
In the panel: press ]] in the Controls pane until you reach LSP TOKENS.
LSP TOKENS 5 customized
rust_analyzer · gopls ● in your code
⏎ colour B I U S style X reset
TYPES
██ ● parameter shapes B [I] U S *
██ ● struct HashMap [B] I U S *
██ ● interface Shape B I [U]S *
...
MODIFIERS style only
░░ ● deprecated old_total B I U[S]*
B I U S badges show which styles are on; * and a highlighted name mark a customized token.lifetime, selfKeyword, builtinType, mutable, trait…).| Key | Action |
|---|---|
Enter |
Pick a color: a palette key (follows the theme and blend sliders) or a custom #hex; the current one is marked ● |
B / I / U / S |
Toggle bold / italic / underline / strikethrough |
X |
Reset the token to the theme default |
The preview pane has an LSP sample that uses the real token groups, so every change shows immediately. Customizations are part of undo/redo, Apply, Save to config, Export and blends.
Check that the colors are applied: :ThemeForge doctor has a section
LSP tokens in your open buffers. For every customized token it counts the places in your
code drawn with your color, e.g. type.parameter 34/34 OK. When a more specific group wins
somewhere it says OVERRIDDEN by @lsp.typemod… (e.g. "max"); style that word with
:ThemeForge token. Only lines that have been on screen are counted.
From your code: put the cursor on any word and run :ThemeForge token.
It lists the semantic tokens under the cursor, most specific first
(@lsp.typemod.parameter.declaration, @lsp.mod.declaration,
@lsp.type.parameter), and opens a menu to set the color, toggle styles or
reset. Changes apply immediately; run :ThemeForge save to keep them.
vim.keymap.set("n", "<leader>Tk", "<cmd>ThemeForge token<cr>", { desc = "ThemeForge: style token under cursor" })
In code:
require("themeforge").apply({
lsp_tokens = {
["@lsp.type.parameter"] = { fg = "orange", italic = true }, -- palette key
["@lsp.type.interface"] = { fg = "#7dcfff", bold = true }, -- hex
["@lsp.type.property"] = { underline = true }, -- style only
["@lsp.mod.deprecated"] = { strikethrough = true },
["@lsp.mod.readonly"] = { italic = true },
},
})
fg: a palette key (purple, blue, cyan, green, yellow, orange, red, fg, fg2, comment) or #rrggbbbold, italic, underline, strikethrough: booleans"@lsp.type.parameter", "lsp.type.parameter" or "type.parameter"fg keep a sensible default color; modifiers without fg only add the stylePanel tokens: class, interface, struct, enum, enumMember, type, typeParameter,
namespace, parameter, variable, property, function, method, macro, decorator,
and the modifiers readonly, static, async, deprecated, defaultLibrary, plus whatever
your running servers use. Any other @lsp.* group (including @lsp.typemod.* and
language-specific ones like @lsp.type.parameter.rust) can be set through lsp_tokens in code.
Good to know
settings = { gopls = { semanticTokens = true } }.@lsp.typemod.function.defaultLibrary (priority 127) beats
@lsp.mod.* (126), which beats @lsp.type.function (125). Neovim links some typemod
groups by default (for example built-in functions to @function.builtin), so styling
function does not change Math.max. Use :ThemeForge token on that word to style the exact group.type +
modifier (@lsp.typemod.type.interface). Styling interface / struct also styles those
equivalents unless you customize them yourself.local tf = require("themeforge")
tf.open()
tf.close()
tf.apply("tokyonight-night")
tf.apply({ theme = "github-dark", ui = { bold_cursor = true } })
tf.apply({ theme = "github-dark", colors = { purple = "#cba6f7" } })
tf.apply({ theme = "nord", mix = { warm = 20, brightness = 60 } })
tf.apply({ lsp_tokens = { ["@lsp.type.parameter"] = { fg = "orange", italic = true } } })
tf.apply_profile("high-contrast")
tf.save("~/.config/nvim/lua/theme.lua")
tf.export("my-theme") -- writes colors/my-theme.lua
tf.reset()
tf.doctor()
-- Fired after every apply or preview
vim.api.nvim_create_autocmd("User", {
pattern = "ThemeForgeApplied",
callback = function(ev)
-- ev.data.theme, ev.data.colors (resolved palette), ev.data.preview
end,
})
-- Fired after the configuration is saved to a file
vim.api.nvim_create_autocmd("User", {
pattern = "ThemeForgeSaved",
callback = function(ev) print("saved to " .. ev.data.path) end,
})
| ID | Name | ID | Name |
|---|---|---|---|
tokyonight-storm |
TokyoNight Storm | onedark |
One Dark Pro |
tokyonight-night |
TokyoNight Night | solarized-dark |
Solarized Dark |
catppuccin-mocha |
Catppuccin Mocha | nightfox |
Nightfox |
gruvbox-dark |
Gruvbox Dark | everforest |
Everforest Dark |
nord |
Nord | material-darker |
Material Darker |
rose-pine |
Rosé Pine | oxocarbon |
Oxocarbon |
kanagawa-wave |
Kanagawa Wave | github-dark |
GitHub Dark |
dracula |
Dracula |
Highlights are applied automatically for plugins that are loaded or installed
(detected through lazy.nvim, vim.pack, or the runtimepath):
| Completion | Navigation | UI | Editing |
|---|---|---|---|
| nvim-cmp | nvim-tree / neo-tree | lualine / bufferline | gitsigns |
| blink.cmp | telescope | snacks.nvim | indent-blankline |
| fzf-lua | noice / which-key | flash | |
| trouble | mini.nvim | render-markdown |
Use :ThemeForge compat all to force every integration, or none to disable them.
Run the test suites headlessly:
nvim --headless -u NONE --cmd 'set rtp^=.' \
-c 'runtime plugin/themeforge.lua' \
-c 'luafile tests/smoke.lua' -c 'qa!'
nvim --headless -u NONE --cmd 'set rtp^=.' \
-c 'runtime plugin/themeforge.lua' \
-c 'luafile tests/upgrade_spec.lua' -c 'qa!'
nvim --headless -u NONE --cmd 'set rtp^=.' \
-c 'runtime plugin/themeforge.lua' \
-c 'luafile tests/lsp_tokens_spec.lua' -c 'qa!'
CI runs all three suites plus a Lua syntax check on every push and pull request. See CONTRIBUTING.md for the contribution workflow.
If ThemeForge makes your editor nicer to look at, you can support its development:
Bug reports and feature ideas are welcome in Issues.
MIT License. See LICENSE for details.