This configuration uses the Gruvbox Material theme by default, with support for multiple theme variants. Themes are configured in lua/plugins/theme.lua.
Current theme setup
The active theme is Gruvbox Material:
return {
{
"sainnhe/gruvbox-material",
enabled = true,
lazy = false,
priority = 1000,
init = function()
vim.cmd.colorscheme("gruvbox-material")
vim.g.colors_name = "gruvbox-material"
end,
},
}
The priority = 1000 ensures the theme loads before other plugins. The lazy = false option loads the theme immediately on startup.
Switching themes
To switch to a different theme, toggle the enabled flag:
Disable current theme
Set enabled = false on the current theme:{
"sainnhe/gruvbox-material",
enabled = false, -- Disable this theme
-- ...
}
Enable new theme
Set enabled = true on your preferred theme:{
"comfysage/gruvboxed",
enabled = true, -- Enable this theme
priority = 1000,
opts = {
transparent_background = false,
contrast_dark = "medium",
},
init = function()
vim.cmd.colorscheme("gruvboxed")
end,
}
Restart Neovim
Restart Neovim or run :Lazy sync to apply changes.
Available themes
Gruvbox Material (default)
{
"sainnhe/gruvbox-material",
enabled = true,
lazy = false,
priority = 1000,
init = function()
vim.cmd.colorscheme("gruvbox-material")
vim.g.colors_name = "gruvbox-material"
end,
}
Gruvbox.nvim
{
"https://gitlab.com/motaz-shokry/gruvbox.nvim",
name = "gruvbox",
priority = 1000,
enabled = false,
config = function()
vim.cmd("colorscheme gruvbox")
end,
opts = {
dark_variant = "hard",
dim_inactive_windows = true,
styles = {
transparency = true,
},
},
}
Gruvboxed
Feature-rich Gruvbox variant with extensive customization:
{
"comfysage/gruvboxed",
priority = 1000,
enabled = false,
opts = {
transparent_background = false,
contrast_dark = "medium",
override_terminal = true,
style = {
tabline = { reverse = true, color = "green" },
search = { reverse = false, inc_reverse = true },
types = { italic = true },
keyword = { italic = true },
comment = { italic = false },
},
overrides = {},
},
init = function()
vim.cmd.colorscheme("gruvboxed")
vim.g.colors_name = "gruvboxed"
end,
}
Adding a new theme
Add theme plugin
Add a new theme entry in lua/plugins/theme.lua:{
"author/theme-name",
enabled = false, -- Start disabled
lazy = false,
priority = 1000,
config = function()
vim.cmd.colorscheme("theme-name")
end,
opts = {
-- Theme-specific options
},
}
Install theme
Restart Neovim or run :Lazy sync to install the theme.
Enable permanently
If satisfied, set enabled = true and disable other themes.
Theme customization
Transparency
Enable transparent background:
opts = {
transparent_background = true,
-- or for some themes:
styles = {
transparency = true,
},
}
Contrast levels
opts = {
contrast_dark = "hard", -- "soft", "medium", "hard"
dark_variant = "hard", -- Some themes use this instead
}
Style overrides
Customize specific syntax groups:
opts = {
style = {
types = { italic = true },
keyword = { italic = true, bold = false },
comment = { italic = false },
strings = { italic = false },
},
}
Color overrides
Override specific highlight groups:
opts = {
overrides = {
Normal = { bg = "#1d2021" },
Comment = { fg = "#928374", italic = true },
},
}
Lush.nvim for theme development
The configuration includes Lush.nvim for developing custom themes:
Creating a local theme
Develop themes locally using the dev path:
{
"cosmic-gleam.nvim", -- Your theme name
dev = true, -- Load from dev path
enabled = false,
priority = 1000,
config = function()
vim.cmd.colorscheme("cosmic_gleam")
end,
}
The dev path is configured in lua/core/lazy.lua:25:
dev = {
path = "~/myCodes",
}
Place your theme plugin in ~/myCodes/cosmic-gleam.nvim/ for local development with the dev = true option.
UI customization
Border styles
Customize floating window borders globally:
vim.lsp.handlers["textDocument/hover"] = vim.lsp.with(
vim.lsp.handlers.hover,
{ border = "rounded" }
)
vim.lsp.handlers["textDocument/signatureHelp"] = vim.lsp.with(
vim.lsp.handlers.signature_help,
{ border = "rounded" }
)
vim.diagnostic.config({
float = { border = "rounded" },
})
Lazy.nvim UI
Customize lazy.nvim interface:
ui = {
border = "rounded",
backdrop = 80,
title_pos = "left",
}
Diagnostic signs
Customize diagnostic signs (errors, warnings, etc.):
vim.diagnostic.config({
signs = {
text = {
[vim.diagnostic.severity.ERROR] = " ",
[vim.diagnostic.severity.WARN] = " ",
[vim.diagnostic.severity.INFO] = " ",
[vim.diagnostic.severity.HINT] = " ",
},
numhl = {
[vim.diagnostic.severity.ERROR] = "ErrorMsg",
[vim.diagnostic.severity.WARN] = "WarningMsg",
},
},
})
Testing themes
Preview without restarting
:colorscheme gruvbox-material
:colorscheme gruvboxed
:colorscheme gruvbox
List available colorschemes
Check current colorscheme
Colorscheme in lazy.nvim install
The fallback colorscheme during plugin installation:
install = {
colorscheme = { "gruvbox-material" }
}
Changing this requires the theme to be available during the bootstrap process. Keep gruvbox-material or use a built-in colorscheme like “habamax” or “default”.
Theme-aware plugins
Some plugins automatically adapt to your colorscheme:
- Statusline - Uses theme colors automatically
- Tabline - Integrates with active theme
- Telescope - Respects colorscheme highlights
- Tree-sitter - Enhanced by theme’s treesitter groups
Best practices
- Keep one theme enabled - Multiple enabled themes can conflict
- Set priority to 1000 - Ensures theme loads before other plugins
- Use lazy = false - Themes should load immediately
- Test before committing - Use
:colorscheme to preview changes
- Document customizations - Comment your theme configuration for future reference
Troubleshooting
Colors look wrong
Check terminal true color support:
if vim.fn.has('termguicolors') == 1 then
vim.opt.termguicolors = true
end
Theme not loading
Check plugin installation:
Ensure the theme is installed and not conflicting with another enabled theme.
Highlight groups not working
Clear highlight cache:
:lua vim.api.nvim__redraw({flush=true})