folke / material.nvim

Material colorscheme for NeoVim written in lua

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

material.nvim

A port or Material colorscheme for NeoVim written in lua using colorbuddy.nvim.

Theme is inspired by https://github.com/kaicataldo/material.vim

screen

Features

material.nvim is meant to be a modern colorscheme written in lua for NeoVim that supports a lot of the new features added to NeoVim like built-in lsp and TreeSitter

Installation

Install via your favourite package manager:

" If you are using Vim-Plug
Plug 'tjdevries/colorbuddy.nvim'
Plug 'marko-cerovac/material.nvim'
-- If you are using Packer
use 'tjdevries/colorbuddy.nvim'
use 'marko-cerovac/material.nvim'

Enable the colorscheme:

"Vim-Script:
colorscheme material
--Lua:
require('colorbuddy').colorscheme('material')

Configuration

  • There are 6 different styles available:
    • darker
    • lighter
    • default
    • oceanic
    • palenight
    • deep ocean

Set the desired style using:

"Vim-Script:
let g:material_style = 'darker'
--Lua:
vim.g.material_style = "deep ocean"
  • To enable flat and minimalist UI by removing the lines between split widows use:

screen

"Vim-Script:
let g:material_flat_ui=1
--Lua:
vim.g.material_flat_ui = 1
  • To enable italic comments use:
"Vim-Script:
let g:material_italic_comments=1
--Lua:
vim.g.material_italic_comments = 1
  • To enable italic keywords like: if, then, else, switch, for, do ,while ...
"Vim-Script:
let g:material_italic_keywords=1
--Lua:
vim.g.material_italic_keywords = 1
  • To enable italic function names use:
"Vim-Script:
let g:material_italic_functions=1
--Lua:
vim.g.material_italic_functions = 1

Functions

  • Toggle the style live without the need to exit NeoVim

screen

Just call the function for style switching

"Vim-Script
:lua require('material').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').toggle_style()<CR>
--Lua:
vim.api.nvim_set_keymap('n', '<C-m>', [[<Cmd>lua require('material').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').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').change_style('lighter')<CR>
nnoremap <C-0> :lua require('material').change_style('darker')<CR>
--Lua:
vim.api.nvim_set_keymap('n', '<C-9>', [[<Cmd>lua require('material').change_style('lighter')<CR>]], { noremap = true, silent = true })
vim.api.nvim_set_keymap('n', '<C-0>', [[<Cmd>lua require('material').change_style('darker')<CR>]], { noremap = true, silent = true })

About

Material colorscheme for NeoVim written in lua

License:GNU General Public License v2.0


Languages

Language:Lua 99.9%Language:Vim Script 0.1%