A port or Material colorscheme for NeoVim written in Lua
Material.nvim is meant to be a fast and modern colorscheme written in Lua that supports a lot of the new features added to NeoVim like built-in LSP and TreeSitter
If you want the old version that uses colorbuddy.nvim, you can find it here
-
5 styles to choose from
-
Supported plugins:
-
Ability to change background on sidebar-like windows like Nvim-Tree, Packer, terminal etc.
-
Asynchronous highlight loading which makes the theme extremely fast
-
Added functions for live theme switching without the need to restart NeoVim
- Neovim >= 0.5.0
Install via your favourite package manager:
" If you are using Vim-Plug
Plug 'marko-cerovac/material.nvim'
-- If you are using Packer
use 'marko-cerovac/material.nvim'
Enable the colorscheme:
"Vim-Script:
colorscheme material
--Lua:
require('material').set()
To enable the material-nvim
theme for Lualine
, simply specify it in your lualine settings:
( make sure to set the theme to 'material-nvim', as 'material' already exists built in to lualine)
require('lualine').setup {
options = {
-- ... your lualine config
theme = 'material-nvim'
-- ... your lualine config
}
}
- There are 5 different styles available:
- darker
- lighter
- oceanic
- palenight
- deep ocean
Set the desired style using:
"Vim-Script:
let g:material_style = 'darker'
--Lua:
vim.g.material_style = "deep ocean"
Option | Default | Description |
---|---|---|
material_style | "oceanic" |
The theme comes in five styles, 'darker', 'lighter', 'palenight', 'oceanic' and 'deep ocean' |
material_contrast | true |
Make sidebars and popup menus like nvim-tree and telescope have a different background |
material_lighter_contrast | false |
Increase the contrast for the 'lighter' variant of the theme |
material_italic_comments | false |
Make comments italic |
material_italic_keywords | false |
Make keywords like if, for, while etc. italic |
material_italic_functions | false |
Make function calls and names italic |
material_italic_variables | false |
Make variable names and identifiers italic |
material_borders | false |
Enable the border between verticaly split windows visable |
material_disable_background | false |
Disable the setting of background color so that NeoVim can use your terminal background |
material_variable_color | #717CB4 |
Set a custom color for variables and fields |
-- Example config in lua
vim.g.material_style = 'deep ocean'
vim.g.material_italic_comments = true
vim.g.material_italic_keywords = true
vim.g.material_italic_functions = true
vim.g.material_italic_variables = false
vim.g.material_contrast = true
vim.g.material_borders = false
vim.g.material_disable_background = false
-- Load the colorscheme
require('material').set()
" Example config in Vim-Script
let g:material_style = 'deep ocean'
let g:material_italic_comments = 1
let g:material_italic_keywords = 1
let g:material_italic_functions = 1
let g:material_contrast = 1
" Load the colorsheme
colorscheme material
- Toggle the style live without the need to exit NeoVim
Just call the function for style switching
"Vim-Script
:lua require('material.functions').toggle_style()
"This command toggles the style
The command can also be mapped to a key for fast style switching
"Vim-Script:
nnoremap <C-m> :lua require('material.functions').toggle_style()<CR>
--Lua:
vim.api.nvim_set_keymap('n', '<C-m>', [[<Cmd>lua require('material.functions').toggle_style()<CR>]], { noremap = true, silent = true })
- Change the style to a desired one using the function change_style("desired style")
"Vim-Script:
:lua require('material.functions').change_style("palenight")
"This command changes the style to palenight
The command can also be mapped to a key for fast style switching
"Vim-Script:
nnoremap <C-9> :lua require('material.functions').change_style('lighter')<CR>
nnoremap <C-0> :lua require('material.functions').change_style('darker')<CR>
--Lua:
vim.api.nvim_set_keymap('n', '<C-9>', [[<Cmd>lua require('material.functions').change_style('lighter')<CR>]], { noremap = true, silent = true })
vim.api.nvim_set_keymap('n', '<C-0>', [[<Cmd>lua require('material.functions').change_style('darker')<CR>]], { noremap = true, silent = true })