Skip to content

Commit 46b0131

Browse files
Merge pull request #34 from venkatarenduchintala/docs/readme-theme-section
docs(readme): document plug-n-play theme system
2 parents dda9ec6 + 960cea5 commit 46b0131

1 file changed

Lines changed: 58 additions & 5 deletions

File tree

README.md

Lines changed: 58 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,61 @@ Personal Lua-based Neovim configuration used as a daily IDE for SRE/DevOps work
3737
3838
<br>
3939
40-
# UI Theme
41-
Several UI themes are preconfigured. The active theme is set in `lua/settings.lua`.
42-
Default: [Tokyonight](https://github.com/folke/tokyonight.nvim).
40+
# Themes
41+
42+
Themes use a small plug-n-play system: each colorscheme lives in its own file
43+
under `lua/themes/<name>.lua` that returns a [lazy.nvim](https://github.com/folke/lazy.nvim)
44+
plugin spec. `lua/theme.lua` auto-discovers every file in that directory, so
45+
adding a theme is drop-in — there is no central list to edit. Only the **active**
46+
theme's plugin is installed; the others are never fetched, keeping startup lean.
47+
48+
**Default:** `gruvbox` (Gruvbox Material), set in `lua/settings.lua` via
49+
`require("theme").set_active_theme("gruvbox")`.
50+
51+
## Switching
52+
53+
Use the `:Theme` command (tab-completes across the discovered themes):
54+
55+
```vim
56+
:Theme " show the active theme and list all available
57+
:Theme everforest " select a theme
58+
```
59+
60+
The choice is persisted to a machine-local state file
61+
(`stdpath("data")/active-theme.txt`) and applied on the next launch, where the
62+
active theme installs itself via lazy.nvim. To change the default for a fresh
63+
install, edit the `set_active_theme(...)` call in `lua/settings.lua`.
64+
65+
## Adding a theme
66+
67+
Create `lua/themes/<name>.lua` returning a lazy.nvim spec that loads the
68+
colorscheme in its `config` function:
69+
70+
```lua
71+
return {
72+
"author/mytheme.nvim",
73+
config = function()
74+
vim.o.background = "dark"
75+
vim.cmd.colorscheme("mytheme")
76+
end,
77+
}
78+
```
79+
80+
It is discovered automatically and becomes selectable via `:Theme mytheme`.
81+
82+
## Included themes
83+
84+
Alongside the previously bundled colorschemes, several low-eyestrain dark themes
85+
(medium contrast, warm, desaturated) are included for long editing sessions:
86+
87+
- `gruvbox_material_soft` — Gruvbox Material, medium background, low UI contrast
88+
- `everforest` — warm green-grey, muted
89+
- `kanagawa` — muted "ink painting" palette
90+
- `tokyonight_moon` — softer Tokyonight variant
91+
- `zenbones` — contrast-engineered, warm (requires [`lush.nvim`](https://github.com/rktjmp/lush.nvim))
92+
93+
The status line ([lualine](https://github.com/nvim-lualine/lualine.nvim)) uses
94+
`theme = "auto"`, so it follows whichever colorscheme is active.
4395

4496
<br>
4597

@@ -76,9 +128,10 @@ Plugin-specific mappings live in `lua/plugins/configs/`. LSP mappings are define
76128
│ ├── plugins/
77129
│ │ ├── init.lua # Plugin list (lazy.nvim entry point)
78130
│ │ └── configs/ # Per-plugin configuration files
131+
│ ├── themes/ # One file per colorscheme (see Themes section)
79132
│ ├── mappings.lua # Core key mappings
80-
│ ├── settings.lua # Neovim options and active theme selection
81-
│ └── theme.lua # Theme switcher logic
133+
│ ├── settings.lua # Neovim options and default theme selection
134+
│ └── theme.lua # Theme auto-discovery loader + :Theme command
82135
├── test/ # CI validation suite (see test/README.md)
83136
│ ├── ci_validate.sh # Orchestrates all validation steps
84137
│ ├── fixtures/ # Source files used as treesitter parse targets

0 commit comments

Comments
 (0)