sainnhe / gruvbox-material

Gruvbox with Material Palette
MIT License
1.83k stars 164 forks source link

Transparency does not work in unused portion of nvimtree #198

Closed REN-aissance closed 3 months ago

REN-aissance commented 4 months ago

I have done the following steps before reporting this issue:

Operating system/version

Arch Linux (6.7.6-arch1-1)

Terminal emulator/version

konsole 23.08.5

$TERM environment variable

xterm-256color

Tmux version

No response

Feature matrix

==============================================================================
crates: require("crates.health").check()

Checking plugins ~
- OK null-ls.nvim installed

Checking external dependencies ~
- OK curl installed
- OK xdg-open installed

==============================================================================
lazy: require("lazy.health").check()

lazy.nvim ~
- OK Git installed
- OK no existing packages found by other package managers
- OK packer_compiled.lua not found

==============================================================================
mason: require("mason.health").check()

mason.nvim ~
- WARNING mason.nvim version v1.0.1
  - ADVICE:
    - The latest version of mason.nvim is: v1.10.0
- OK neovim version >= 0.7.0

mason.nvim [Registries] ~
- OK Registry `require("mason-registry.index")` is installed.
- OK Registry `github.com/mason-org/mason-registry version: 2024-03-02-basic-bath` is installed.

mason.nvim [Core utils] ~
- OK unzip: `UnZip 6.00 of 20 April 2009, by Info-ZIP.  Maintained by C. Spieler.  Send`
- WARNING wget: not available
  - ADVICE:
    - spawn: wget failed with exit code - and signal -. wget is not executable
- OK curl: `curl 8.6.0 (x86_64-pc-linux-gnu) libcurl/8.6.0 OpenSSL/3.2.1 zlib/1.3.1 brotli/1.1.0 zstd/1.5.5 libidn2/2.3.7 libpsl/0.21.2 libssh2/1.11.0 nghttp2/1.59.0 nghttp3/1.2.0`
- OK gzip: `gzip 1.13`
- OK tar: `tar (GNU tar) 1.35`
- OK bash: `GNU bash, version 5.2.26(1)-release (x86_64-pc-linux-gnu)`
- OK sh: `Ok`

mason.nvim [Languages] ~
- WARNING luarocks: not available
  - ADVICE:
    - spawn: luarocks failed with exit code - and signal -. luarocks is not executable
- WARNING Composer: not available
  - ADVICE:
    - spawn: composer failed with exit code - and signal -. composer is not executable
- WARNING PHP: not available
  - ADVICE:
    - spawn: php failed with exit code - and signal -. php is not executable
- OK Go: `go version go1.22.0 linux/amd64`
- OK node: `v21.6.2`
- OK Ruby: `ruby 3.0.6p216 (2023-03-30 revision 23a532679b) [x86_64-linux]`
- OK cargo: `cargo 1.76.0-nightly (6790a5127 2023-11-10)`
- WARNING julia: not available
  - ADVICE:
    - spawn: julia failed with exit code - and signal -. julia is not executable
- OK python3: `Python 3.11.7`
- OK java: `openjdk version "21.0.2" 2024-01-16`
- OK javac: `javac 21.0.2`
- OK RubyGem: `3.3.25`
- OK npm: `10.5.0`
- OK pip3: `pip 24.0 from /usr/lib/python3.11/site-packages/pip (python 3.11)`

mason.nvim [GitHub] ~
- OK GitHub API rate limit. Used: 1. Remaining: 59. Limit: 60. Reset: 2024年03月03日 15時12分52秒.
  Install and authenticate via gh-cli to increase rate limit.

==============================================================================
null-ls: require("null-ls.health").check()

- no sources registered

==============================================================================
nvim: require("nvim.health").check()

Configuration ~
- WARNING Missing user config file: /home/ren/.config/lvim/init.vim
  - ADVICE:
    - :help |init.vim|

Runtime ~
- OK $VIMRUNTIME: /usr/share/nvim/runtime

Performance ~
- OK Build type: Release

Remote Plugins ~
- OK Up to date

terminal ~
- key_backspace (kbs) terminfo entry: `key_backspace=\177`
- key_dc (kdch1) terminfo entry: `key_dc=\E[3~`
- $COLORTERM="truecolor"

==============================================================================
nvim-treesitter: require("nvim-treesitter.health").check()

Installation ~
- WARNING `tree-sitter` executable not found (parser generator, only needed for :TSInstallFromGrammar, not required for :TSInstall)
- OK `node` found v21.6.2 (only needed for :TSInstallFromGrammar)
- OK `git` executable found.
- OK `cc` executable found. Selected from { vim.NIL, "cc", "gcc", "clang", "cl", "zig" }
  Version: cc (GCC) 13.2.1 20230801
- OK Neovim was compiled with tree-sitter runtime ABI version 14 (required >=13). Parsers must be compatible with runtime ABI.

OS Info:
{
  machine = "x86_64",
  release = "6.7.6-arch1-1",
  sysname = "Linux",
  version = "#1 SMP PREEMPT_DYNAMIC Fri, 23 Feb 2024 16:31:48 +0000"
} ~

Parser/Features         H L F I J
  - bash                ✓ ✓ ✓ . ✓
  - comment             ✓ . . . .
  - gitcommit           ✓ . . . ✓
  - lua                 ✓ ✓ ✓ ✓ ✓
  - markdown_inline     ✓ . . . ✓
  - regex               ✓ . . . .
  - rust                ✓ ✓ ✓ ✓ ✓
  - toml                ✓ ✓ ✓ ✓ ✓
  - vimdoc              ✓ . . . ✓

  Legend: H[ighlight], L[ocals], F[olds], I[ndents], In[j]ections
         +) multiple parsers found, only one will be used
         x) errors found in the query, try to run :TSUpdate {lang} ~

==============================================================================
provider: health#provider#check

Clipboard (optional) ~
- OK Clipboard tool found: xclip

Python 3 provider (optional) ~
- WARNING No Python executable found that can `import neovim`. Using the first available executable for diagnostics.
- WARNING Could not load Python 3:
  /usr/bin/python3 does not have the "neovim" module.
  python3.12 not found in search path or not executable.
  /usr/bin/python3.11 does not have the "neovim" module.
  python3.10 not found in search path or not executable.
  python3.9 not found in search path or not executable.
  python3.8 not found in search path or not executable.
  python3.7 not found in search path or not executable.
  /usr/bin/python does not have the "neovim" module.
  - ADVICE:
    - See :help |provider-python| for more information.
    - You may disable this provider (and warning) by adding `let g:loaded_python3_provider = 0` to your init.vim
- Executable: Not found

Python virtualenv ~
- OK no $VIRTUAL_ENV

Ruby provider (optional) ~
- Ruby: ruby 3.0.6p216 (2023-03-30 revision 23a532679b) [x86_64-linux]
- WARNING `neovim-ruby-host` not found.
  - ADVICE:
    - Run `gem install neovim` to ensure the neovim RubyGem is installed.
    - Run `gem environment` to ensure the gem bin directory is in $PATH.
    - If you are using rvm/rbenv/chruby, try "rehashing".
    - See :help |g:ruby_host_prog| for non-standard gem installations.
    - You may disable this provider (and warning) by adding `let g:loaded_ruby_provider = 0` to your init.vim

Node.js provider (optional) ~
- Node.js: v21.6.2
- WARNING Missing "neovim" npm (or yarn, pnpm) package.
  - ADVICE:
    - Run in shell: npm install -g neovim
    - Run in shell (if you use yarn): yarn global add neovim
    - Run in shell (if you use pnpm): pnpm install -g neovim
    - You may disable this provider (and warning) by adding `let g:loaded_node_provider = 0` to your init.vim

Perl provider (optional) ~
- WARNING "Neovim::Ext" cpan module is not installed
  - ADVICE:
    - See :help |provider-perl| for more information.
    - You may disable this provider (and warning) by adding `let g:loaded_perl_provider = 0` to your init.vim

==============================================================================
vim.lsp: require("vim.lsp.health").check()

- LSP log level : WARN
- Log path: /home/ren/.local/state/lvim/lsp.log
- Log size: 5 KB

vim.lsp: Active Clients ~
- lua_ls (id=1, root_dir=/home/ren/.config/lvim/lua/)

==============================================================================
vim.treesitter: require("vim.treesitter.health").check()

- Nvim runtime ABI version: 14
- OK Parser: bash       ABI: 14, path: /home/ren/.local/share/lunarvim/site/pack/lazy/opt/nvim-treesitter/parser/bash.so
- OK Parser: comment    ABI: 13, path: /home/ren/.local/share/lunarvim/site/pack/lazy/opt/nvim-treesitter/parser/comment.so
- OK Parser: gitcommit  ABI: 14, path: /home/ren/.local/share/lunarvim/site/pack/lazy/opt/nvim-treesitter/parser/gitcommit.so
- OK Parser: lua        ABI: 13, path: /home/ren/.local/share/lunarvim/site/pack/lazy/opt/nvim-treesitter/parser/lua.so
- OK Parser: markdown_inline ABI: 13, path: /home/ren/.local/share/lunarvim/site/pack/lazy/opt/nvim-treesitter/parser/markdown_inline.so
- OK Parser: regex      ABI: 13, path: /home/ren/.local/share/lunarvim/site/pack/lazy/opt/nvim-treesitter/parser/regex.so
- OK Parser: rust       ABI: 14, path: /home/ren/.local/share/lunarvim/site/pack/lazy/opt/nvim-treesitter/parser/rust.so
- OK Parser: toml       ABI: 13, path: /home/ren/.local/share/lunarvim/site/pack/lazy/opt/nvim-treesitter/parser/toml.so
- OK Parser: vimdoc     ABI: 14, path: /home/ren/.local/share/lunarvim/site/pack/lazy/opt/nvim-treesitter/parser/vimdoc.so

==============================================================================
which-key: require("which-key.health").check()

WhichKey: checking conflicting keymaps ~
- WARNING conflicting keymap exists for mode **"n"**, lhs: **"ys"**
- rhs: `<Plug>Ysurround`
- WARNING conflicting keymap exists for mode **"n"**, lhs: **"yS"**
- rhs: `<Plug>YSurround`
- WARNING conflicting keymap exists for mode **"n"**, lhs: **"gb"**
- rhs: `<Plug>(comment_toggle_blockwise)`
- WARNING conflicting keymap exists for mode **"n"**, lhs: **"gc"**
- rhs: `<Plug>(comment_toggle_linewise)`
- WARNING buffer-local keymap overriding global for mode **"n"**, buf: 0, lhs: **"c"**
- old rhs: `<CMD>edit /home/ren/.config/lvim/config.lua <CR>`
- new rhs: `<cmd>lua require("which-key").show("c", {mode = "n", auto = true})<cr>`

Minimal vimrc that can reproduce this bug.

I'm a noob and using lunarvim don't know how to do this

Steps to reproduce this bug using minimal vimrc

I'm a noob and using lunarvim don't know how to do this

Expected behavior

Empty nvimtree portion should be transparent (couldn't figure out how to reopen #180 so duplicating it)

Actual behavior

Empty nvimtree portion is not transparent

antoineco commented 4 months ago

Thanks for reporting, I'll look into this.

antoineco commented 4 months ago

Could you please share your lunarvim config?

REN-aissance commented 4 months ago

Here you go!

-- Read the docs: https://www.lunarvim.org/docs/configuration
-- Video Tutorials: https://www.youtube.com/watch?v=sFA9kX-Ud_c&list=PLhoH5vyxr6QqGu0i7tt_XoVK9v-KvZ3m6
-- Forum: https://www.reddit.com/r/lunarvim/
-- Discord: https://discord.com/invite/Xb9B4Ny
require("banners")

lvim.builtin.which_key.mappings["t"] = { "<cmd>ToggleTerm shell=/bin/zsh<CR>", "Terminal" }
lvim.transparent_window = true
lvim.colorscheme = "gruvbox-material"
lvim.builtin.nvimtree.setup.view.side = "right"
lvim.format_on_save = true
vim.opt.relativenumber = true
vim.opt.shell = "/usr/bin/zsh"
vim.cmd("set clipboard=unnamedplus")

lvim.plugins = {
  { "nvim-treesitter/nvim-treesitter-context" },
  { "polirritmico/monokai-nightasty.nvim" },
  {
    "sainnhe/gruvbox-material",
    config = function()
      vim.cmd("g:gruvbox_material_transparent_background = 2")
    end,
  },
  { "tpope/vim-surround" },
  {
    "folke/todo-comments.nvim",
    event = "BufRead",
    config = function()
      require("todo-comments").setup()
    end,
  },
  {
    'wfxr/minimap.vim',
    build = "cargo install --locked code-minimap",
    cmd = { "Minimap", "MinimapClose", "MinimapToggle", "MinimapRefresh", "MinimapUpdateHighlight" },
    config = function()
      vim.cmd("let g:minimap_width = 5")
      vim.cmd("let g:minimap_auto_start = 1")
    end,
  },
  {
    'saecki/crates.nvim',
    config = function()
      require('crates').setup()
    end,
  },
  { "folke/zen-mode.nvim" },
  { "nvim-lua/plenary.nvim" },
  { "windwp/nvim-spectre" },
}
antoineco commented 4 months ago

Do you observe the same behavior with lvim.transparent_window = false?

REN-aissance commented 4 months ago

Screenshot_20240304_021906 Screenshot_20240304_022015 Here is the difference between false in the first screenshot and true in the second

antoineco commented 4 months ago

Ah right, the file tree window is dimmed by default.

There has been a few attempts to make the config right for multiple combinations of configuration, but if a remember correctly this comes with limitations. The bottom part of the window is called "EndOfBuffer" in Vim terms. Here is a discussion which describes how certain combinations of configurations don't play too nice with dimmed EndOfBuffers: https://github.com/sainnhe/everforest/issues/123#issuecomment-1653362619

Still, it doesn't explain why we don't make this part of the window transparent. Like I said, I'm going to investigate further.

REN-aissance commented 4 months ago

Much appreciated and good luck!

antoineco commented 4 months ago

I just looked into this, but wasn't able to reproduce. For me the entire NvimTree window is transparent, including the EndOfBuffer:

gruvbox-transparent

Could you please post the output of the Vim command :verbose highlight NvimTreeEndOfBuffer? It should show:

:verbose highlight NvimTreeEndOfBuffer
NvimTreeEndOfBuffer xxx cleared

If your output is different, it will at least give us a hint about what is setting the highlight group.

REN-aissance commented 3 months ago

Apologies for the extremely late reply. The output I recieve is: NvimTreeEndOfBuffer xxx ctermfg=233 ctermbg=233 guifg=#1b1b1b guibg=#1b1b1b Last set from ~/.local/share/lvim/site/pack/lazy/opt/gruvbox-material/autoload/gruvbox_material.vim line 286

antoineco commented 3 months ago

The output suggests that configuration.transparent_background is set to its default value of 0.

Now that I looked closer at your configuration, the reason is obvious to me. You are trying to set an option using vim.cmd(), which is incorrect. You should instead be setting the value of global variables as follows:

config = function()
  vim.g.my_option = value
end,

You can refer to my last screenshot for a full, working example of setting up the colorscheme via lazy.nvim.


Here is the relevant place where these highlights are configured, for reference.

https://github.com/sainnhe/gruvbox-material/blob/80331fbbec9ba18590a17bc6b7d277d96c05c2b6/colors/gruvbox-material.vim#L1620-L1625

REN-aissance commented 3 months ago

Apologies and thank you! It looks great now