GithubHelp home page GithubHelp logo

aviyn / material.nvim Goto Github PK

View Code? Open in Web Editor NEW

This project forked from marko-cerovac/material.nvim

0.0 1.0 0.0 9.28 MB

:trident: Material colorscheme for NeoVim written in Lua with built-in support for native LSP, TreeSitter and many more plugins

License: GNU General Public License v2.0

Vim Script 0.52% Lua 99.48%

material.nvim's Introduction

๐ŸŒŠ material.nvim

screen

๐Ÿ”ฑ Info

A port of 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

โœจ Features

โšก๏ธ Requirements

  • Neovim >= 0.5.0

โš“ Installation

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'

๐Ÿฌ Usage

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
  }
}

For a comlete guide on usage and Configuration of the theme, see :help material.nvim.

โš™๏ธ Configuration

  • 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"

Available options:

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_hide_eob false Hide the end of buffer lines ( ~ )
material_variable_color #717CB4 Set a custom color for variables and fields
material_custom_colors {} Override the default colors and use your own
-- 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
--vim.g.material_custom_colors = { black = "#000000", bg = "#0F111A" }

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

โ›ต Functions

  • Toggle the style live without the need to exit NeoVim

screen

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 <leader>mm :lua require('material.functions').toggle_style()<CR>
--Lua:
vim.api.nvim_set_keymap('n', '<leader>mm', [[<Cmd>lua require('material.functions').toggle_style()<CR>]], { noremap = true, silent = true })
  • Toggle the end of buffer lines ( ~ )

Call the built in function for toggling buffer lines

"Vim-Script
:lua require('material.functions').toggle_eob()
"This command toggles the end of buffer lines

The command can also be mapped to a key to toggle the lines live

"Vim-Script:
nnoremap <leader>me :lua require('material.functions').toggle_eob()<CR>
--Lua:
vim.api.nvim_set_keymap('n', '<leader>me', [[<Cmd>lua require('material.functions').toggle_eob()<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 <leader>ml :lua require('material.functions').change_style('lighter')<CR>
nnoremap <leader>md :lua require('material.functions').change_style('darker')<CR>
--Lua:
vim.api.nvim_set_keymap('n', '<leader>ml', [[<Cmd>lua require('material.functions').change_style('lighter')<CR>]], { noremap = true, silent = true })
vim.api.nvim_set_keymap('n', '<leader>md', [[<Cmd>lua require('material.functions').change_style('darker')<CR>]], { noremap = true, silent = true })

material.nvim's People

Contributors

aceforeverd avatar chaitanyabsprip avatar huyvohcmc avatar ianhomer avatar marko-cerovac avatar niyabits avatar rti avatar scthijsse avatar shubham-cpp avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.