gruvbox-material
gruvbox-material copied to clipboard
[Feature Request] File Explorer Shading
Hi there, thanks for the awesome theme.
I would like to suggest an option for shading the window of the file explorer (or in this case, nvim-tree.lua). It would add a nice touch to the theme. An example can be seen over at nightfox.nvim.
Just so I understand correctly, by shading you mean making the background of the file explorer darker than the default background, right?
Yes that is exactly what I mean.
@Alex-vZyl I'm looking into this. So far I haven't found a way to do it without autocmds and window-local highlights (only supported in Neovim), but I may have overlooked something. I'll keep you posted.
@Alex-vZyl OK, I found a much simpler way. It turns out nvim-tree provides all the highlighting groups needed to override its background color without relying on window-local highlights.
Could you please add this to your Neovim config and let me know what you think about the result?
:page_facing_up: init.vim
" Apply custom highlights on colorscheme change.
" Must be declared before executing ':colorscheme'.
augroup custom_highlights_gruvboxmaterial
autocmd!
" file explorer background
autocmd ColorScheme gruvbox-material
\ hi NvimTreeNormal guibg=#181818 |
\ hi NvimTreeEndOfBuffer guibg=#181818
augroup END
colorscheme gruvbox-material
:page_facing_up: init.lua
-- Apply custom highlights on colorscheme change.
-- Must be declared before executing ':colorscheme'.
grpid = vim.api.nvim_create_augroup('custom_highlights_gruvboxmaterial', {})
vim.api.nvim_create_autocmd('ColorScheme', {
group = grpid,
pattern = 'gruvbox-material',
command = -- file explorer background
'hi NvimTreeNormal guibg=#181818 |' ..
'hi NvimTreeEndOfBuffer guibg=#181818'
})
vim.cmd'colorscheme gruvbox-material'
Please bear in mind that #181818
is not in the color scheme's palette, and is only presented as an example.
I'll add two new colors later, three plugins need to be optimized:
- nvim-tree
- bufferline
- barbar
@antoineco Here it is in my setup.
It works well! Definitely makes using file explorers inside neovim a lot nicer. It is a slightly different shade than what bufferline and toggleterm uses, but it is not that big of a deal. If you want you can support those plugins as well, but that is up to you.
Is there any way we can make this shading feature optional? Not everyone likes it.