sainnhe / gruvbox-material

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

Cursor is too hard to see in main area but obvious in the cmdline of folke/noice.nvim #178

Closed TD-Sky closed 1 year ago

TD-Sky commented 1 year ago

I have done the following steps before reporting this issue:

Operating system/version

Arch Linux 6.3.1-arch1-1

Terminal emulator/version

wezterm 20230408-112425-69ae8472

$TERM environment variable

xterm-256color

Tmux version

No response

Feature matrix

==============================================================================
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
- WARNING {nvim-lspconfig}: overriding <config>

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

LazyVim ~
- OK Using Neovim >= 0.8.0
- OK `git` is installed
- OK `rg` is installed
- OK `fd` is installed
- WARNING `lazygit` is not installed

==============================================================================
mkdp: health#mkdp#check

- Platform: linux
- Nvim Version: NVIM v0.9.0
- Node version: v18.10.0

- Script: /home/door/.local/share/LazyVim/lazy/markdown-preview.nvim/app/server.js
- Script exists: 1
- OK Using node

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

noice.nvim ~
- OK **Neovim** >= 0.8.0
- OK Not running inside **Neovide**
- OK You're using a GUI that should work ok
- OK **vim.go.lazyredraw** is not enabled
- OK **nvim-notify** is installed
- OK **TreeSitter vim** parser is installed
- WARNING **TreeSitter regex** parser is not installed. Highlighting of the cmdline for regex might be broken
- WARNING **TreeSitter lua** parser is not installed. Highlighting of the cmdline for lua might be broken
- OK **TreeSitter bash** parser is installed
- OK **TreeSitter markdown** parser is installed
- OK **TreeSitter markdown_inline** parser is installed
- OK `vim.notify` is set to **Noice**
- OK `vim.lsp.handlers["textDocument/hover"]` is set to **Noice**
- OK `vim.lsp.handlers["textDocument/signatureHelp"]` is set to **Noice**
- OK `vim.lsp.handlers["window/showMessage"]` is set to **Noice**
- OK `vim.lsp.util.convert_input_to_markdown_lines` is set to **Noice**
- OK `vim.lsp.util.stylize_markdown` is set to **Noice**

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

Configuration ~
- OK no issues found

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~`
- $TERM_PROGRAM="WezTerm"
- $COLORTERM="truecolor"

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

Installation ~
- OK `tree-sitter` found 0.20.8 (parser generator, only needed for :TSInstallFromGrammar)
- OK `node` found v18.10.0 (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.1.1 20230429
- 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.3.1-arch1-1",
  sysname = "Linux",
  version = "#1 SMP PREEMPT_DYNAMIC Mon, 01 May 2023 17:42:39 +0000"
} ~

Parser/Features         H L F I J
  - bash                ✓ ✓ ✓ . ✓
  - bibtex              ✓ . ✓ ✓ .
  - c                   ✓ ✓ ✓ ✓ ✓
  - cmake               ✓ . ✓ . .
  - comment             ✓ . . . .
  - cpp                 ✓ ✓ ✓ ✓ ✓
  - css                 ✓ . ✓ ✓ ✓
  - dot                 ✓ . . . ✓
  - go                  ✓ ✓ ✓ ✓ ✓
  - gomod               ✓ . . . ✓
  - haskell             ✓ . ✓ . ✓
  - html                ✓ ✓ ✓ ✓ ✓
  - java                ✓ ✓ ✓ ✓ ✓
  - javascript          ✓ ✓ ✓ ✓ ✓
  - json                ✓ ✓ ✓ ✓ .
  - json5               ✓ . . . ✓
  - kotlin              ✓ ✓ ✓ . ✓
  - latex               ✓ . ✓ . ✓
  - markdown            ✓ . ✓ . ✓
  - markdown_inline     ✓ . . . ✓
  - perl                ✓ . ✓ . ✓
  - python              ✓ ✓ ✓ ✓ ✓
  - rust                ✓ ✓ ✓ ✓ ✓
  - scheme              ✓ . ✓ . ✓
  - scss                ✓ . ✓ ✓ .
  - slint               ✓ . . ✓ .
  - toml                ✓ ✓ ✓ ✓ ✓
  - typescript          ✓ ✓ ✓ ✓ ✓
  - vim                 ✓ ✓ ✓ . ✓
  - vue                 ✓ . ✓ ✓ ✓
  - yaml                ✓ ✓ ✓ ✓ ✓

  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) ~
- `g:python3_host_prog` is not set.  Searching for python3 in the environment.
- Multiple python3 executables found.  Set `g:python3_host_prog` to avoid surprises.
- Executable: /usr/bin/python3
- Other python executable: /bin/python3
- Python version: 3.11.3
- pynvim version: 0.4.3
- OK Latest pynvim is installed.

Python virtualenv ~
- OK no $VIRTUAL_ENV

Ruby provider (optional) ~
- WARNING `ruby` and `gem` must be in $PATH.
  - ADVICE:
    - Install Ruby and verify that `ruby` and `gem` commands work.

Node.js provider (optional) ~
- Node.js: v18.10.0
- 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/door/.local/state/LazyVim/lsp.log
- Log size: 1389 KB

vim.lsp: Active Clients ~
- No active clients

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

- Nvim runtime ABI version: 14
- OK Parser: bash       ABI: 14, path: /home/door/.local/share/LazyVim/lazy/nvim-treesitter/parser/bash.so
- OK Parser: bibtex     ABI: 13, path: /home/door/.local/share/LazyVim/lazy/nvim-treesitter/parser/bibtex.so
- OK Parser: c          ABI: 14, path: /home/door/.local/share/LazyVim/lazy/nvim-treesitter/parser/c.so
- OK Parser: cmake      ABI: 14, path: /home/door/.local/share/LazyVim/lazy/nvim-treesitter/parser/cmake.so
- OK Parser: comment    ABI: 13, path: /home/door/.local/share/LazyVim/lazy/nvim-treesitter/parser/comment.so
- OK Parser: cpp        ABI: 14, path: /home/door/.local/share/LazyVim/lazy/nvim-treesitter/parser/cpp.so
- OK Parser: css        ABI: 13, path: /home/door/.local/share/LazyVim/lazy/nvim-treesitter/parser/css.so
- OK Parser: dot        ABI: 13, path: /home/door/.local/share/LazyVim/lazy/nvim-treesitter/parser/dot.so
- OK Parser: go         ABI: 14, path: /home/door/.local/share/LazyVim/lazy/nvim-treesitter/parser/go.so
- OK Parser: gomod      ABI: 13, path: /home/door/.local/share/LazyVim/lazy/nvim-treesitter/parser/gomod.so
- OK Parser: haskell    ABI: 14, path: /home/door/.local/share/LazyVim/lazy/nvim-treesitter/parser/haskell.so
- OK Parser: html       ABI: 13, path: /home/door/.local/share/LazyVim/lazy/nvim-treesitter/parser/html.so
- OK Parser: java       ABI: 14, path: /home/door/.local/share/LazyVim/lazy/nvim-treesitter/parser/java.so
- OK Parser: javascript ABI: 14, path: /home/door/.local/share/LazyVim/lazy/nvim-treesitter/parser/javascript.so
- OK Parser: json       ABI: 14, path: /home/door/.local/share/LazyVim/lazy/nvim-treesitter/parser/json.so
- OK Parser: json5      ABI: 13, path: /home/door/.local/share/LazyVim/lazy/nvim-treesitter/parser/json5.so
- OK Parser: kotlin     ABI: 14, path: /home/door/.local/share/LazyVim/lazy/nvim-treesitter/parser/kotlin.so
- OK Parser: latex      ABI: 14, path: /home/door/.local/share/LazyVim/lazy/nvim-treesitter/parser/latex.so
- OK Parser: markdown   ABI: 13, path: /home/door/.local/share/LazyVim/lazy/nvim-treesitter/parser/markdown.so
- OK Parser: markdown_inline ABI: 13, path: /home/door/.local/share/LazyVim/lazy/nvim-treesitter/parser/markdown_inline.so
- OK Parser: perl       ABI: 13, path: /home/door/.local/share/LazyVim/lazy/nvim-treesitter/parser/perl.so
- OK Parser: python     ABI: 14, path: /home/door/.local/share/LazyVim/lazy/nvim-treesitter/parser/python.so
- OK Parser: rust       ABI: 14, path: /home/door/.local/share/LazyVim/lazy/nvim-treesitter/parser/rust.so
- OK Parser: scheme     ABI: 14, path: /home/door/.local/share/LazyVim/lazy/nvim-treesitter/parser/scheme.so
- OK Parser: scss       ABI: 13, path: /home/door/.local/share/LazyVim/lazy/nvim-treesitter/parser/scss.so
- OK Parser: slint      ABI: 14, path: /home/door/.local/share/LazyVim/lazy/nvim-treesitter/parser/slint.so
- OK Parser: toml       ABI: 13, path: /home/door/.local/share/LazyVim/lazy/nvim-treesitter/parser/toml.so
- OK Parser: typescript ABI: 14, path: /home/door/.local/share/LazyVim/lazy/nvim-treesitter/parser/typescript.so
- OK Parser: vim        ABI: 14, path: /home/door/.local/share/LazyVim/lazy/nvim-treesitter/parser/vim.so
- OK Parser: vue        ABI: 13, path: /home/door/.local/share/LazyVim/lazy/nvim-treesitter/parser/vue.so
- OK Parser: yaml       ABI: 13, path: /home/door/.local/share/LazyVim/lazy/nvim-treesitter/parser/yaml.so

==============================================================================
vimtex: health#vimtex#check

VimTeX ~
- OK Vim version should have full support!
- WARNING biber is not executable!
  - ADVICE:
    - Biber is often required so this may give unexpected problems.
- WARNING Zathura requires xdotool for forward search!
- OK Compiler should work!

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

WhichKey: checking conflicting keymaps ~
- WARNING conflicting keymap exists for mode **"n"**, lhs: **"gc"**
- rhs: ` `
- WARNING conflicting keymap exists for mode **"n"**, lhs: **"sd"**
- rhs: `<Plug>(sandwich-delete)`
- WARNING conflicting keymap exists for mode **"n"**, lhs: **"sr"**
- rhs: `<Plug>(sandwich-replace)`
- WARNING buffer-local keymap overriding global for mode **"n"**, buf: 0, lhs: **"g"**
- old rhs: `:Telescope live_grep <CR>`
- new rhs: `<cmd>lua require("which-key").show("g", {mode = "n", auto = true})<cr>`
- WARNING buffer-local keymap overriding global for mode **"n"**, buf: 0, lhs: **"c"**
- old rhs: `:e $MYVIMRC <CR>`
- new rhs: `<cmd>lua require("which-key").show("c", {mode = "n", auto = true})<cr>`
- WARNING buffer-local keymap overriding global for mode **"n"**, buf: 0, lhs: **"s"**
- old rhs: `:lua require("persistence").load() <cr>`
- new rhs: `<cmd>lua require("which-key").show("s", {mode = "n", auto = true})<cr>`

Minimal vimrc that can reproduce this bug.

Use init.lua:

vim.opt.clipboard = "unnamedplus"
vim.opt.termguicolors = true
vim.o.background = "light"

local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
    vim.fn.system({
        "git",
        "clone",
        "--filter=blob:none",
        "https://github.com/folke/lazy.nvim.git",
        "--branch=stable", -- latest stable release
        lazypath,
    })
end
vim.opt.rtp:prepend(lazypath)

require("lazy").setup({
    {
        "sainnhe/gruvbox-material",
        config = function()
            vim.g.gruvbox_material_backgroud = "soft"
            vim.g.gruvbox_material_current_word = "underline"
            vim.g.gruvbox_material_diagnostic_virtual_text = "colored"
            vim.g.gruvbox_material_visual = "red background"
            vim.cmd.colorscheme("gruvbox-material")
        end,
    },
    { "MunifTanjim/nui.nvim" },
    {
        "folke/noice.nvim",
        opts = {
            lsp = {
                override = {
                    ["vim.lsp.util.convert_input_to_markdown_lines"] = true,
                    ["vim.lsp.util.stylize_markdown"] = true,
                },
            },
            presets = {
                bottom_search = true,
                command_palette = true,
                long_message_to_split = true,
            },
        },
    },
})

Steps to reproduce this bug using minimal vimrc

  1. Edit a text file foo.txt with nvim -u init.lua.
  2. Write something.
  3. Enter command mode(i.e. press :).

Expected behavior

The color of cursor in main area should be same as the one in command mode.

It should be obvious like in the GUI mode.

Actual behavior

The cursor in main area looks very pale and is hard to see.

antoineco commented 1 year ago

The shape and color of the cursor in the "main area" is controlled by your terminal emulator.

Here is what I see in WezTerm on Windows 11 using the configuration you shared:

image image

TD-Sky commented 1 year ago

You are right! I am using Gruvbox color scheme in Wezterm.

When the Gruvbox is light in Wezterm, the cursor in dark background is hard to see in Neovim; when the Gruvbox is dark in Wezterm, the cursor in light background is hard to see in Neovim.

It seems like I cannot use Gruvbox in Wezterm because I use both modes in Neovim every day.

antoineco commented 1 year ago

I highly recommend this article if you want to synchronize dark/light mode between your terminal emulator and Vim: https://arslan.io/2021/02/15/automatic-dark-mode-for-terminal-applications/

(Neo)Vim being a terminal application, the cursor color will always depend on the terminal emulator. This is not specific to WezTerm, and is true regardless of the color scheme you use.

You can also look into :h 'guicursor' for customizing the cursor appearance from within (Neo)Vim.

TD-Sky commented 1 year ago

Thank you very much!

TD-Sky commented 1 year ago

I found that setting config force_reverse_video_cursor = true can make the cursor always clear.