marko-cerovac / material.nvim Goto Github PK
View Code? Open in Web Editor NEW: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
: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
The following is my whole config on the theme. Everything works fine, I just want to set some colors because they blend too much on my monitor...
I've put this config on LineNr to show that is not working, this hex should mean red but any color that I put, turns out white. That happens on the other config mentioned on readme as well... I've tested the other themes, and seem that is not applying the colors or the custom_highlights erase and leave the default value, idk.
Other thing, what are all the custom highlights that I can put there? I did not found on the doc and looking in the code (not understanding much) could not find a reference... could you add on the doc please?
When the darker style is selected, the indent line displayed by the indent-blankline plugin is not "highlighted" for the current context.
The IndentBlanklineContextChar
highlighting has the same color as the IndentBlanklineChar
one. Could you please specify a different color for IndentBlanklineContextChar
to make the context more visible?
Hello @marko-cerovac.
I've been playing around with some settings here but couldn't exactly make a background transparent using your theme. Do you have any hints how this can be achieved?
They are broken as you can see here.
Quite a shame, since your plugin provides proper highlight groups for all colorschemes and only contestors are navarasu/onedark.nvim (no light color) and adisen99/codeschool.nvim (key words for control flow have bad contrast and color ).
You could maybe elaborate in 2-3 sentences on what color groups one wants to choose for good programming experience.
add option for transparent bg
My configuration:
use { -- Colorscheme
'marko-cerovac/material.nvim',
branch = 'main',
config = function()
vim.g.material_style = 'deep ocean'
require'material'.setup({
contrast = true,
borders = true,
contrast_windows = {
"terminal", -- Darker terminal background
"term", -- Darker terminal background
"packer", -- Darker packer background
"qf" -- Darker qf list background
},
disable = {term_colors = true},
custom_highlights = {
DiffAdd = '#002500',
DiffDelete = '#250000'
}
})
vim.cmd [[colorscheme material]]
end
}
However DiffAdd is set to ctermbg=4
which is practically invisble in my setup.
So my question is, how do I set custom highlights properly?
Doing this (after vim.cmd [[colorscheme material]]
) doesn't work:
vim.cmd([[
hi DiffAdd guibg=#002500 guifg=None gui=None
hi DiffDelete guibg=#250000 guifg=None gui=None
]])
Hi, this is not a real issue, more of a question on my side. I see you have a g:material_style
option to switch between different variations of your colorscheme. Why didn't you release six different colorschemes, e.g. material
, material-darker
, material-lighter
and so on? I know you're not the first one to do so - ayu
is the first colorscheme that comes to my mind that is configured the same way - but I'm not a big fan of this solution. Here's why:
g:material_style
, g:ayucolor
and so on; with six different colorschemes, it would just be :colorscheme material_<tab>
and you get all the versions;I understand that your solution doesn't pollute the available colorschemes list with many entries - it's one colorscheme instead of six - but I would consider this an acceptable tradeoff.
Please let me know your reasoning behind this, and thanks for the theme, it really looks great.
The settings in theme.lua use material.highlight
and material.title
, which dont have good contrast (which usually one wants on searching for things).
It should have sufficient contrast to 1.background and 2.font.
Any idea how this could be fixed?
I know this theme set highlight group for Dashborad. But I wonder know how to prevent it?
I try to config highlight group for Dashboard myself in init.vim after colorscheme, but failed.
I was playing with neovims floating windows and saw that border option isn't working. A guy on reddit helped me pin it down to the colorscheme.
Cloud you please add a highlight for FloatBorder
to make sure it's visible? By default it links to VertSplit
, maybe there could be an option to make VertSplit
foreground visible? That way we could have the UI more broken apart for people who like it that way.
Hi !
A recent change in neovim make some parts of the theme never apply. Indeed some LspDiagnosticsSignxxx items changed to DiagnosticDefaultxxx.
Regards,
Thank you for such great colorscheme. I would like to ask whether it is possible to make the self keyword in Python a little bit more differentiable? Self keyword has the same color as parameters so it's quite difficult to differentiate between a function and a class method.
I've found two issues that might make the colorscheme work incorrectly depending on what highlight groups the user was using before.
hi clear
, before setting the highlight groupsmaterial.vim
only requires
the material lua file, but since requires are cached, the theme will only load the first time. Try switching to a default theme and then back to material. won't work. To fix this, you should probably wrap the lua file in a function and call that function from the vim colors file.Is it possible to change the color of the comments? I would like the color green or a bright one, because they blend too much with my monitor. Also, could I change the color of a certain word? I would like the work 'TODO' to be yellow or something like that to get more attention. Thanks.
Updated the colorscheme using minpac and italics stopped showing in my init.vim where they were before. Tried setting italic strings in both lua and vimscript and they haven't come back.
Is there a gruvbox-material variant ?
(like, https://github.com/sainnhe/gruvbox-material)
if not, can someone guide me on the resources required to implement it. Thanks !
I get the following error on startup
E5108: Error executing lua ...plugged/material.nvim/lua/material/colors.lua:55: attempt to index field 'text_contrast' (a nil value)
I believe this is because the table in lua/material/config.lua
is not initialized, so any require('material/config')
gives you a table without the defaults (including the nested tables). A call to setup
in config.lua
has fixed this for me:
Config.setup()
return Config
I am using
$ nvim --version
NVIM v0.5.0
Build type: RelWithDebInfo
LuaJIT 2.1.0-beta3
...
and I am loading the theme in my init.vim
without any lua configuration of the colorscheme. I do configure lualine with the material theme though.
let g:material_style = 'darker'
colorscheme material
It's been a while since this feature is in a TODO and I miss it a lot to change my accent color.
Hello! Really loving this color scheme. I just recently downloaded nvim-tree
and I wanted some more stark colors for the signs in my tree. I am using Neovide as my terminal gui but the behavior is the same with just regular terminal nvim.
Here is my setup in my top level .config/nvim/init.lua
file, located all the way at the bottom of my config:
-- check if using gui
if vim.api.nvim_eval("exists('g:neovide')") == 1 then
vim.g.material_style = 'deep ocean'
-- did setup before calling "colorscheme material" per the instructions
-- doesn't actually matter if setup comes before or after the command, colors do not apply
require('material').setup{
custom_highlights = {
NvimTreeFolderIcon = 'blue',
NvimTreeGitNew = 'blue',
NvimTreeGitDirty = 'red',
NvimTreeGitStaged = 'LightGreen'
}
}
vim.cmd[[ colorscheme material ]]
vim.cmd[[ set guifont=Hack\ Nerd\ Font:h12 ]]
-- put this down here just in case
-- colors still do not work
vim.cmd[[ highlight NvimTreeFolderIcon ctermfg=blue guifg=blue ]]
vim.cmd[[ highlight NvimTreeGitNew ctermfg=blue guifg=blue ]]
vim.cmd[[ highlight NvimTreeGitDirty ctermfg=red guifg=red ]]
vim.cmd[[ highlight NvimTreeGitStaged ctermfg=DarkGreen guifg=LightGreen ]]
end
The thing is though, even though the colors are not applied, I can manually apply them in my gui (neovide) by running ":hi NvimTreeGitStaged guibg=LightGreen". So the command itself is valid, but I guess it is not being read by material.nvim? I can confirm the if block is running because I do get the material deep ocean theme, and I get print statements in any part of the if block.
I also have those same highlight groups listed in my .config/nvim/plugin/nvim-tree.lua
file, so those highlight groups are getting defined in two different places but still no colors.
This is neovide/neovim with all those configs, before I manually set the highlight group :
And then this is what it looks like after I manually set the highlight group:
I even put the code block above my if statement so that I can see the material theme get applied without a gui (just regular terminal nvim) and the behavior is the same. I presume that the theme erases everything in order to apply the beautiful colors but how do I set custom highlight groups, especially for highlight groups related to other plugins that I download?
Thanks!
hi! this is one nice theme!
is there any way, or can it be implemented, to inject the full custom base colors, instead of just the named presets.
the main reason for the request - I like the darker
one the most, but I'd like to make it a tad bit darker, more contrasting
I am using the oceanic variant. When I open my file explorer (nvim-tree.lua), the backgrounds are different (which is great!):
If I open a few file in other tabs, all of a sudden the background of those buffers matches the file explorer's background:
The best I can tell, it's when I open a file from another folder. Yet, any other file I open afterward has this background.
Also, after pasting this screenshot, I just noticed the line numbers have disappeared as well.
I get the following error when starting neovim with the material colorscheme:
Error detected while processing /home/myhome/.vim/plugged/material.nvim/colors/material.vim: line 3: E5105: Error while calling lua chunk: /home/myhome/.vim/plugged/material.nvim/lua/material.lua:36: attempt to index local 'v' (a nil value)
No idea why, I'm not that well versed in lua.
Hello,
It would be great to have an option to define a separate background-color for each the sidebar and the float popup.
For example, I like to have my tree on the left to have the same color as my normal editview, but the floating popup on DEEP OCEAN is barely distinguible from the edit view.
Thanks for this great colorscheme!
Hi, thanks for this great colorscheme.
I'm using the deep ocean
variant and I'm having trouble seeing MatchParen
(automatically highlighted matching parenthesis when cursor is on a parenthesis). Would it be possible to add an option to make it at least bold? That makes it a bit more distinguishable from others.
For dark backgrounds the color contrast is good, but for light colors its quite bad.
Is there no mathematical model to compute something like this like inverting the gray value to do that?
I am impressive with the extensivness of how many attribute this theme covers. Well done.
I like that the colors of the terminal emulator is set using vim.g.terminal_color_NN
, but don't like that the 0-7 and 8-15 are the same colors.
I tried to manually set the colors in my rc, but ecause of the variables are set in async part of the code, it is not yielding the result I was looking for. Would it be possible to allow for a workaround for this? Either:
If any of these options seem reasonable to you, I will gladly contribute with a PR.
material.nvim/lua/material.lua
Line 265 in 064b567
I'm getting the following error with the most recent ColorBuddy:
Probably because the group Search is defined a couple of lines below the one I linked?
In my neovim config file I have set it to render spaces and tabs using the following configuration:
vim.o.list = true
vim.o.list = 'tab:▸ ,space:·'
This doesn't however look very great using this theme:
Is there a way to set the color of the whitespace characters? Preferably I would like them to be even less visible than comments. But being equal to comments would be an improvement over how they are rendered now.
Would it be possible to implement a way to easily replace the theme colors of specific elements? Without using the highlight option directly, and in lua to facilitate
Something like:
rgb cterm string
local color = {'#ffffff', 255, 'color-name'}
material.custom_highlight('ELEMENT', {bg="#fff" fg=color})
Or if something like this already exists, how could I do it?
I'm currently using a hack with autocmd to change colors but I don't feel it's good enough
let g:material_italic_comments = 1
let g:material_italic_strings = 1
colorscheme material
"here is a comment
let str = "a_string"
as example.vim
and then open it, and use it as my vimrc: vim example.vim -u example.vim
. No italic comments or strings.
But the comment and the string are not italic.
It does work, however when I use this example config file:
lua vim.g.material_italic_comments = true
lua vim.g.material_italic_strings = true
colorscheme material
"comment
let str_example = "string"
I just ran plugin update for my local nvim and noticed the background color (or more) of "deep ocean" is wrongly displayed.
I then changed material.nvim
and colorbuddy
installation to these commits:
use {
'tjdevries/colorbuddy.nvim',
commit = 'cb9e044ebf0b690a56ebb4018cf300703f8dbec1'
}
use {
'marko-cerovac/material.nvim',
commit = '4ea2318b495ae1da5fa3fb96fe90992efcf54988'
}
set()
here.setup()
did not remove warnings. So use { 'marko-cerovac/material.nvim', config = function() require('material').setup() end } --<l>m
did not make message go away.vim.cmd[[colorscheme material]]
required? Any technical reasons? Toggling colors also enables them, ie with map('n', '<leader>m', [[<cmd>lua require('material.functions').toggle_style()<CR>]], opts)
everything works, so I am surprised that I need an additonal config option.It would be nice to have a high contrast mode for the darker style. Currently, line numbers and code comments aren't easy to read.
Hello! I have bad YAML syntax highlighting (gray key and gray value) with commit 2be93812babaec9311443e22eb96ce0723b0a728
and later.
Thanks!
I'm using the deep ocean
variant and when I hover over a section in :Neogit
, it turns into black on black resulting in unreadable text.
Could you add https://github.com/sainnhe/gruvbox-material, please?
On MacOS using iterm2, zsh, and neovim. I followed the directions in the README to add to my init.lua. It does not allow me to call require("material").set() in my init.lua as listed in the README.
When calling I get the error:
E5113: Error while calling lua chunk: (personal details) : attempt to call field 'set' (a nil value)
I was able to get this working by using the vimscript command:
vim.cmd[[colorscheme material]]
vim.g.material_style = "palenight"
Otherwise great theme. Keep up the great work!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.