A complete overhaul of the gruvbox original theme, based on both ellisonleao's gruvbox.nvim and folke's tokyonight.nvim themes.
Dark | ||
---|---|---|
Hard | Medium | Soft |
![]() |
![]() |
![]() |
Light | ||
Hard | Medium | Soft |
![]() |
![]() |
![]() |
Neovim 0.9.0+
{ "pedrog14/gruvbox.nvim", lazy = false, priority = 1000, opts = {...} }
Plug 'pedrog14/gruvbox.nvim'
use { "pedrog14/gruvbox.nvim" }
Inside your lua config:
vim.opt.background = "dark" -- or "light" for light mode
vim.cmd.colorscheme("gruvbox")
Inside init.vim
:
set background=dark " or "light" for light mode
colorscheme gruvbox
The default settings for gruvbox are:
{
cache = true,
contrast = nil, --[[@type GruvboxContrast]]
dim_inactive = false,
terminal_colors = true,
transparent_mode = false,
color_override = {}, --[[@type GruvboxColors]]
group_override = {}, --[[@type table<string, vim.api.keyset.highlight>]]
plugins = {
all = package.loaded.lazy == nil,
auto = true,
},
-- stylua: ignore
style = {
bold = true,
italic = true,
reverse = true,
strikethrough = true,
undercurl = true,
underline = true,
comments = {}, --[[@type vim.api.keyset.highlight]]
indent = {}, --[[@type vim.api.keyset.highlight]]
operators = {}, --[[@type vim.api.keyset.highlight]]
selection = {}, --[[@type vim.api.keyset.highlight]]
signs = {}, --[[@type vim.api.keyset.highlight]]
strings = {}, --[[@type vim.api.keyset.highlight]]
tabline = {}, --[[@type vim.api.keyset.highlight]]
},
}
VERY IMPORTANT: Make sure to call setup() BEFORE calling the colorscheme command, to use your custom configs!
You can specify your own colors. For example:
require("gruvbox").setup({
color_override = {
bg0 = "#000000"
}
})
If you don't enjoy the current color for a specific highlight group, now you can just override it in the setup. For example:
require("gruvbox").setup({
group_override = {
SignColumn = { bg = "#ff9900" }
}
})
It also works with treesitter groups and lsp semantic highlight tokens:
require("gruvbox").setup({
group_override = {
["@lsp.type.method"] = { bg = "#ff9900" },
["@comment.lua"] = { bg = "#000000" },
}
})
Please notice that the values on the overrides must follow the pattern that can be seen on synIDattr
.