nibocn / gruvbox-material

Gruvbox with Material Palette

Home Page:https://www.vim.org/scripts/script.php?script_id=5814

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Introduction

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)
๐ƒ๐š๐ซ๐ค ๐‹๐ข๐ ๐ก๐ญ
๐‡๐š๐ซ๐ material-hard-dark material-hard-light
๐Œ๐ž๐๐ข๐ฎ๐ฆ material-medium-dark material-medium-light
๐’๐จ๐Ÿ๐ญ material-soft-dark material-soft-light
mix: Color palette obtained by calculating the mean of the other two(click on this line to preview)
๐ƒ๐š๐ซ๐ค ๐‹๐ข๐ ๐ก๐ญ
๐‡๐š๐ซ๐ mix-hard-dark mix-hard-light
๐Œ๐ž๐๐ข๐ฎ๐ฆ mix-medium-dark mix-medium-light
๐’๐จ๐Ÿ๐ญ mix-soft-dark mix-soft-light
original: The color palette used in the original gruvbox(click on this line to preview)
๐ƒ๐š๐ซ๐ค ๐‹๐ข๐ ๐ก๐ญ
๐‡๐š๐ซ๐ original-hard-dark original-hard-light
๐Œ๐ž๐๐ข๐ฎ๐ฆ original-medium-dark original-medium-light
๐’๐จ๐Ÿ๐ญ original-soft-dark original-soft-light

This color scheme uses the material palette by default, you can use a global variable to switch to another palette.

Features

  • 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 ๐ŸŽ‰

Installation

Via Plugin Manager

Take vim-plug for example:

Plug 'sainnhe/gruvbox-material'

For better syntax highlighting support, please install sheerun/vim-polyglot.

Manually

  1. Clone this repository.
  2. Copy /path/to/gruvbox-material/autoload/gruvbox_material.vim to ~/.vim/autoload/.
  3. Copy /path/to/gruvbox-material/colors/gruvbox-material.vim to ~/.vim/colors/ .
  4. Copy /path/to/gruvbox-material/doc/gruvbox-material.txt to ~/.vim/doc/ and execute :helptags ~/.vim/doc/ to generate help tags.
  5. To install airline theme, copy /path/to/gruvbox-material/autoload/airline/themes/gruvbox_material.vim to ~/.vim/autoload/airline/themes/gruvbox_material.vim .
  6. To install lightline theme, copy /path/to/gruvbox-material/autoload/lightline/colorscheme/gruvbox_material.vim to ~/.vim/autoload/lightline/colorscheme/gruvbox_material.vim .

AUR

There is a package available for Arch Linux users in AUR: gruvbox-material-git

Usage

Vim

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

Airline

To enable airline color scheme, put this in your vimrc:

let g:airline_theme = 'gruvbox_material'

To apply it without reloading:

:AirlineTheme gruvbox_material

Lightline

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()

FAQ

Q: It doesn't work as expected.

A:

  1. This color scheme is mainly designed for true colors, set termguicolors is required. Check output of vim --version, maybe your vim doesn't support termguicolors.
  2. Maybe your terminal emulator doesn't support true colors, you can test it using this script.
  3. 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?
  4. 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:

  1. Install a font that supports cursive italics, for example icursive-nerd-font.
  2. Enable italic keywords in this color scheme: let g:gruvbox_material_enable_italic = 1
  3. 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?

A: Fira Code iCursive Op.

Related Projects

Note: The following projects are sorted by alphabet.

IDE

Code Editors

Terminal Emulators

Other

More Color Schemes

Contributing

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.

Credits

Inspirations

License

MIT License ยฉ sainnhe

About

Gruvbox with Material Palette

https://www.vim.org/scripts/script.php?script_id=5814

License:MIT License


Languages

Language:Vim Script 100.0%