Gruvbox Material is a modified version of Gruvbox, the contrast is adjusted to be softer in order to protect developers' eyes.
There are 3 palettes available in this color scheme:
material
: Carefully designed to have a soft contrast(click on this line to preview)
๐๐๐ซ๐ค | ๐๐ข๐ ๐ก๐ญ | |
---|---|---|
๐๐๐ซ๐ | ||
๐๐๐๐ข๐ฎ๐ฆ | ||
๐๐จ๐๐ญ |
mix
: Color palette obtained by calculating the mean of the other two(click on this line to preview)
๐๐๐ซ๐ค | ๐๐ข๐ ๐ก๐ญ | |
---|---|---|
๐๐๐ซ๐ | ||
๐๐๐๐ข๐ฎ๐ฆ | ||
๐๐จ๐๐ญ |
original
: The color palette used in the original gruvbox(click on this line to preview)
๐๐๐ซ๐ค | ๐๐ข๐ ๐ก๐ญ | |
---|---|---|
๐๐๐ซ๐ | ||
๐๐๐๐ข๐ฎ๐ฆ | ||
๐๐จ๐๐ญ |
This color scheme uses the material
palette by default, you can use a global variable to switch to another palette.
- Carefully designed color palette for eye protection.
- Switch back to the original color palette whenever you like.
- Highly customizable.
- Rich support for common file types and plugins.
- Italic support ๐
Take vim-plug for example:
Plug 'sainnhe/gruvbox-material'
For better syntax highlighting support, please install sheerun/vim-polyglot.
- Clone this repository.
- Copy
/path/to/gruvbox-material/autoload/gruvbox_material.vim
to~/.vim/autoload/
. - Copy
/path/to/gruvbox-material/colors/gruvbox-material.vim
to~/.vim/colors/
. - Copy
/path/to/gruvbox-material/doc/gruvbox-material.txt
to~/.vim/doc/
and execute:helptags ~/.vim/doc/
to generate help tags. - To install airline theme, copy
/path/to/gruvbox-material/autoload/airline/themes/gruvbox_material.vim
to~/.vim/autoload/airline/themes/gruvbox_material.vim
. - To install lightline theme, copy
/path/to/gruvbox-material/autoload/lightline/colorscheme/gruvbox_material.vim
to~/.vim/autoload/lightline/colorscheme/gruvbox_material.vim
.
There is a package available for Arch Linux users in AUR: gruvbox-material-git
Put something like this in your vimrc:
" important!!
if has('termguicolors')
set termguicolors
endif
" for dark version
set background=dark
" for light version
set background=light
" set contrast
" this configuration option should be placed before `colorscheme gruvbox-material`
" available values: 'hard', 'medium'(default), 'soft'
let g:gruvbox_material_background = 'soft'
colorscheme gruvbox-material
See :help gruvbox-material-configuration
for more configuration options.
If you want to apply this color scheme temporarily, run this command in vim(this may cause broken colors):
:colorscheme gruvbox-material
To enable airline color scheme, put this in your vimrc:
let g:airline_theme = 'gruvbox_material'
To apply it without reloading:
:AirlineTheme gruvbox_material
To enable lightline color scheme, put this in your vimrc:
let g:lightline = {}
let g:lightline.colorscheme = 'gruvbox_material'
" or this line
let g:lightline = {'colorscheme' : 'gruvbox_material'}
To apply it without reloading:
:let g:lightline.colorscheme = 'gruvbox_material'
:call lightline#init()
:call lightline#colorscheme()
Q: It doesn't work as expected.
A:
- This color scheme is mainly designed for true colors,
set termguicolors
is required. Check output ofvim --version
, maybe your vim doesn't supporttermguicolors
. - Maybe your terminal emulator doesn't support true colors, you can test it using this script.
- If you are running vim in tmux, you need to override default true colors of tmux, as tmux cannot display true colors properly: #1246 How to use true colors in vim under tmux?
- There are many highlight group links in syntax files while a color scheme may change them, enabling one color scheme based on another color scheme enabled is very likely to cause colors to break. If any color is broken, you can enable the color scheme in your vimrc instead of after vim startup.
Q: I can't apply airline/lightline color scheme.
A: The name is gruvbox_material
instead of gruvbox-material
. I have to use underline for some grammatical reasons.
Q: How to enable cursive italic keywords?
A:
- Install a font that supports cursive italics, for example icursive-nerd-font.
- Enable italic keywords in this color scheme:
let g:gruvbox_material_enable_italic = 1
- Disable italic comment(optional):
let g:gruvbox_material_disable_italic_comment = 1
Q: What's your status line configuration?
A: See this article.
Q: What's the font used here?
Note: The following projects are sorted by alphabet.
- Intellij IDEA (WIP) by @Happin3ss
- Xcode by @zxYin
- Alacritty by @kamek-pf
- iTerm2 by @AAlakkad
- Kitty by @rsaihe
- Tilix by @sainnhe
- Windows Terminal by @sainnhe
If you want to port this color scheme to other apps, see autoload/gruvbox_material.vim
and src/palette
for the definition of all color palettes.
Also, you can subscribe to #28 to get the updates to the color palettes.
- morhetz/gruvbox: original gruvbox
- atom.io: the
white
color in the dark variant - zefei/cake16: the
black
color in the light variant - Google Material Design
MIT License ยฉ sainnhe