Skip to main content
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:
lua/plugins/theme.lua
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:
1

Disable current theme

Set enabled = false on the current theme:
lua/plugins/theme.lua
{
  "sainnhe/gruvbox-material",
  enabled = false,  -- Disable this theme
  -- ...
}
2

Enable new theme

Set enabled = true on your preferred theme:
lua/plugins/theme.lua
{
  "comfysage/gruvboxed",
  enabled = true,  -- Enable this theme
  priority = 1000,
  opts = {
    transparent_background = false,
    contrast_dark = "medium",
  },
  init = function()
    vim.cmd.colorscheme("gruvboxed")
  end,
}
3

Restart Neovim

Restart Neovim or run :Lazy sync to apply changes.

Available themes

Gruvbox Material (default)

lua/plugins/theme.lua
{
  "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

lua/plugins/theme.lua
{
  "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:
lua/plugins/theme.lua
{
  "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

1

Add theme plugin

Add a new theme entry in lua/plugins/theme.lua:
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
  },
}
2

Install theme

Restart Neovim or run :Lazy sync to install the theme.
3

Test theme

Test the theme manually:
:colorscheme theme-name
4

Enable permanently

If satisfied, set enabled = true and disable other themes.

Theme customization

Transparency

Enable transparent background:
lua/plugins/theme.lua
opts = {
  transparent_background = true,
  -- or for some themes:
  styles = {
    transparency = true,
  },
}

Contrast levels

lua/plugins/theme.lua
opts = {
  contrast_dark = "hard",    -- "soft", "medium", "hard"
  dark_variant = "hard",     -- Some themes use this instead
}

Style overrides

Customize specific syntax groups:
lua/plugins/theme.lua
opts = {
  style = {
    types = { italic = true },
    keyword = { italic = true, bold = false },
    comment = { italic = false },
    strings = { italic = false },
  },
}

Color overrides

Override specific highlight groups:
lua/plugins/theme.lua
opts = {
  overrides = {
    Normal = { bg = "#1d2021" },
    Comment = { fg = "#928374", italic = true },
  },
}

Lush.nvim for theme development

The configuration includes Lush.nvim for developing custom themes:
lua/plugins/theme.lua
{
  "rktjmp/lush.nvim",
}

Creating a local theme

Develop themes locally using the dev path:
lua/plugins/theme.lua
{
  "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:
lua/core/lazy.lua
ui = {
  border = "rounded",
  backdrop = 80,
  title_pos = "left",
}

Diagnostic signs

Customize diagnostic signs (errors, warnings, etc.):
lua/plugins/lsp/init.lua
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

:colorscheme <Tab>

Check current colorscheme

:echo g:colors_name

Colorscheme in lazy.nvim install

The fallback colorscheme during plugin installation:
lua/core/lazy.lua
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

  1. Keep one theme enabled - Multiple enabled themes can conflict
  2. Set priority to 1000 - Ensures theme loads before other plugins
  3. Use lazy = false - Themes should load immediately
  4. Test before committing - Use :colorscheme to preview changes
  5. 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:
:Lazy
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})

Build docs developers (and LLMs) love