gruvbox-material
gruvbox-material copied to clipboard
add support for TODO marker in todo-comments
Operating system/version
Linux Mint 20.2
Terminal emulator/version
Kitty 0.15.0
$TERM environment variable
xterm-kitty
Tmux version
No response
Feature matrix
null-ls: require("null-ls.health").check()
========================================================================
- OK: prettier: the command "prettier" is executable.
- OK: stylua: the command "stylua" is executable.
nvim: health#nvim#check
========================================================================
## Configuration
- OK: no issues found
## Performance
- OK: Build type: Release
## Remote Plugins
- OK: Up to date
## terminal
- INFO: key_backspace (kbs) terminfo entry: key_backspace=\177
- INFO: key_dc (kdch1) terminfo entry: key_dc=\E[3~
- INFO: $COLORTERM='truecolor'
nvim-lsp-installer: require("nvim-lsp-installer.health").check()
========================================================================
## nvim-lsp-installer report
- OK: neovim version >= 0.6.0
- WARNING: **Composer**: not available
- WARNING: **PHP**: not available
- WARNING: **javac**: not available
- WARNING: **julia**: not available
- OK: **tar**: `tar (GNU tar) 1.30`
- OK: **gzip**: `gzip 1.10`
- OK: **wget**: `GNU Wget 1.20.3 built on linux-gnu.`
- OK: **python3**: `Python 3.8.10`
- OK: **node**: `v17.4.0`
- OK: **Ruby**: `ruby 2.7.0p0 (2019-12-25 revision 647ee6f091) [x86_64-linux-gnu]`
- WARNING: **Go**: unsupported version `go version go1.13.8 linux/amd64`. Go version must be >= 1.17.
- OK: **curl**: `curl 7.68.0 (x86_64-pc-linux-gnu) libcurl/7.68.0 OpenSSL/1.1.1f zlib/1.2.11 brotli/1.0.7 libidn2/2.2.0 libpsl/0.21.0 (+libidn2/2.2.0) libssh/0.9.3/openssl/zlib nghttp2/1.40.0 librtmp/2.3`
- OK: **bash**: `GNU bash, version 5.0.17(1)-release (x86_64-pc-linux-gnu)`
- OK: **sh**: `Ok`
- OK: **RubyGem**: `3.1.2`
- OK: **java**: `Ok`
- OK: **npm**: `8.3.2`
- OK: **pip3**: `pip 20.0.2 from /usr/lib/python3/dist-packages/pip (python 3.8)`
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 v17.4.0 (only needed for :TSInstallFromGrammar)
- OK: `git` executable found.
- OK: `cc` executable found. Selected from { vim.NIL, "cc", "gcc", "clang", "cl", "zig" }
Version: cc (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0
- OK: Neovim was compiled with tree-sitter runtime ABI version 13 (required >=13). Parsers must be compatible with runtime ABI.
## Parser/Features H L F I J
- ocaml_interface✓ ✓ ✓ . ✓
- beancount ✓ . ✓ . .
- python ✓ ✓ ✓ ✓ ✓
- sparql ✓ ✓ ✓ ✓ ✓
- comment ✓ . . . .
- lua ✓ ✓ ✓ ✓ ✓
- ocaml ✓ ✓ ✓ . ✓
- ninja ✓ . ✓ ✓ .
- ql ✓ ✓ . ✓ ✓
- glsl ✓ ✓ ✓ ✓ ✓
- json ✓ ✓ ✓ ✓ .
- pug ✓ . . . ✓
- ledger ✓ . ✓ ✓ ✓
- php ✓ ✓ ✓ ✓ ✓
- clojure ✓ ✓ ✓ . ✓
- supercollider ✓ ✓ ✓ ✓ ✓
- hack ✓ . . . .
- heex ✓ ✓ ✓ ✓ ✓
- typescript ✓ ✓ ✓ ✓ ✓
- fennel ✓ ✓ . . ✓
- query ✓ ✓ ✓ ✓ ✓
- cpp ✓ ✓ ✓ ✓ ✓
- vue ✓ . ✓ ✓ ✓
- latex ✓ . ✓ . ✓
- make ✓ . . . ✓
- rst ✓ ✓ . . ✓
- css ✓ . ✓ ✓ ✓
- glimmer ✓ . . . .
- erlang . . . . .
- gowork ✓ . . . ✓
- vala ✓ . . . .
- regex ✓ . . . .
- norg . . . . .
- haskell ✓ . . . ✓
- nix ✓ ✓ ✓ . ✓
- svelte ✓ . ✓ ✓ ✓
- prisma ✓ . . . .
- http ✓ . . . ✓
- c ✓ ✓ ✓ ✓ ✓
- fortran ✓ . ✓ ✓ .
- java ✓ ✓ . ✓ ✓
- llvm ✓ . . . .
- jsonc ✓ ✓ ✓ ✓ ✓
- hjson ✓ ✓ ✓ ✓ ✓
- gomod ✓ . . . ✓
- dart ✓ ✓ . ✓ ✓
- verilog ✓ ✓ ✓ . ✓
- pioasm ✓ . . . ✓
- json5 ✓ . . . ✓
- bash ✓ ✓ ✓ . ✓
- vim ✓ ✓ . . ✓
- cmake ✓ . ✓ . .
- yaml ✓ ✓ ✓ ✓ ✓
- zig ✓ . ✓ ✓ ✓
- bibtex ✓ . ✓ ✓ .
- r ✓ ✓ . ✓ .
- julia ✓ ✓ ✓ ✓ ✓
- pascal ✓ ✓ ✓ ✓ ✓
- gdscript ✓ ✓ . ✓ ✓
- jsdoc ✓ . . . .
- turtle ✓ ✓ ✓ ✓ ✓
- tsx ✓ ✓ ✓ ✓ ✓
- toml ✓ ✓ ✓ ✓ ✓
- fusion ✓ ✓ ✓ ✓ .
- javascript ✓ ✓ ✓ ✓ ✓
- markdown ✓ . ✓ . ✓
- yang ✓ . ✓ . .
- hocon ✓ . . . ✓
- surface ✓ . ✓ ✓ ✓
- dot ✓ . . . ✓
- go ✓ ✓ ✓ ✓ ✓
- c_sharp ✓ ✓ ✓ . ✓
- elixir ✓ ✓ ✓ ✓ ✓
- cuda ✓ ✓ ✓ ✓ ✓
- commonlisp ✓ ✓ ✓ . .
- eex ✓ . . . ✓
- kotlin ✓ ✓ ✓ . ✓
- ruby ✓ ✓ ✓ ✓ ✓
- fish ✓ ✓ ✓ ✓ ✓
- scala ✓ . ✓ . ✓
- dockerfile ✓ . . . ✓
- rust ✓ ✓ ✓ ✓ ✓
- elm ✓ . . . ✓
- perl ✓ . . . .
- tlaplus ✓ ✓ ✓ . ✓
- html ✓ ✓ ✓ ✓ ✓
- scss ✓ . . ✓ .
- graphql ✓ . . ✓ ✓
- foam ✓ ✓ ✓ ✓ ✓
- rasi ✓ ✓ ✓ ✓ .
- hcl ✓ . ✓ ✓ ✓
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 2 provider (optional)
- WARNING: No Python executable found that can `import neovim`. Using the first available executable for diagnostics.
- ERROR: Python provider error:
- ADVICE:
- provider/pythonx: Could not load Python 2:
/usr/bin/python2 does not have the "neovim" module. :help |provider-python|
/usr/bin/python2.7 does not have the "neovim" module. :help |provider-python|
python2.6 not found in search path or not executable.
python not found in search path or not executable.
- INFO: Executable: Not found
## Python 3 provider (optional)
- INFO: `g:python3_host_prog` is not set. Searching for python3 in the environment.
- INFO: Multiple python3 executables found. Set `g:python3_host_prog` to avoid surprises.
- INFO: Executable: /usr/bin/python3
- INFO: Other python executable: /bin/python3
- INFO: Python version: 3.8.10
- INFO: pynvim version: 0.4.1 (outdated; from /usr/lib/python3/dist-packages/neovim)
- WARNING: Latest pynvim is NOT installed: 0.4.3
## Python virtualenv
- OK: no $VIRTUAL_ENV
## Ruby provider (optional)
- INFO: Ruby: ruby 2.7.0p0 (2019-12-25 revision 647ee6f091) [x86_64-linux-gnu]
- 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.
## Node.js provider (optional)
- INFO: Node.js: v17.4.0
- WARNING: Missing "neovim" npm (or yarn) package.
- ADVICE:
- Run in shell: npm install -g neovim
- Run in shell (if you use yarn): yarn global add neovim
## Perl provider (optional)
- ERROR: perl provider error:
- ADVICE:
- "Neovim::Ext" cpan module is not installed
telescope: require("telescope.health").check()
========================================================================
## Checking for required plugins
- OK: plenary installed.
- OK: nvim-treesitter installed.
## Checking external dependencies
- OK: rg: found ripgrep 11.0.2
- WARNING: fd: not found. Install [sharkdp/fd](https://github.com/sharkdp/fd) for extended capabilities
## ===== Installed extensions =====
vim.lsp: require("vim.lsp.health").check()
========================================================================
- INFO: LSP log level : WARN
- INFO: Log path: /home/geo/.cache/nvim/lsp.log
- INFO: Log size: 41963 KB
vim.treesitter: require("vim.treesitter.health").check()
========================================================================
- INFO: Runtime ABI version : 13
- OK: Loaded parser for bash: ABI version 13
- OK: Loaded parser for beancount: ABI version 13
- OK: Loaded parser for bibtex: ABI version 13
- OK: Loaded parser for c: ABI version 13
- OK: Loaded parser for c_sharp: ABI version 13
- OK: Loaded parser for clojure: ABI version 13
- OK: Loaded parser for cmake: ABI version 13
- OK: Loaded parser for comment: ABI version 13
- OK: Loaded parser for commonlisp: ABI version 13
- OK: Loaded parser for cpp: ABI version 13
- OK: Loaded parser for css: ABI version 13
- OK: Loaded parser for cuda: ABI version 13
- OK: Loaded parser for dart: ABI version 13
- OK: Loaded parser for dockerfile: ABI version 13
- OK: Loaded parser for dot: ABI version 13
- OK: Loaded parser for eex: ABI version 13
- OK: Loaded parser for elixir: ABI version 13
- OK: Loaded parser for elm: ABI version 13
- OK: Loaded parser for erlang: ABI version 13
- OK: Loaded parser for fennel: ABI version 13
- OK: Loaded parser for fish: ABI version 13
- OK: Loaded parser for foam: ABI version 13
- OK: Loaded parser for fortran: ABI version 13
- OK: Loaded parser for fusion: ABI version 13
- OK: Loaded parser for gdscript: ABI version 13
- OK: Loaded parser for glimmer: ABI version 13
- OK: Loaded parser for glsl: ABI version 13
- OK: Loaded parser for go: ABI version 13
- OK: Loaded parser for gomod: ABI version 13
- OK: Loaded parser for gowork: ABI version 13
- OK: Loaded parser for graphql: ABI version 13
- OK: Loaded parser for hack: ABI version 13
- OK: Loaded parser for haskell: ABI version 13
- OK: Loaded parser for hcl: ABI version 13
- OK: Loaded parser for heex: ABI version 13
- OK: Loaded parser for hjson: ABI version 13
- OK: Loaded parser for hocon: ABI version 13
- OK: Loaded parser for html: ABI version 13
- OK: Loaded parser for http: ABI version 13
- OK: Loaded parser for java: ABI version 13
- OK: Loaded parser for javascript: ABI version 13
- OK: Loaded parser for jsdoc: ABI version 13
- OK: Loaded parser for json: ABI version 13
- OK: Loaded parser for json5: ABI version 13
- OK: Loaded parser for jsonc: ABI version 13
- OK: Loaded parser for julia: ABI version 13
- OK: Loaded parser for kotlin: ABI version 13
- OK: Loaded parser for latex: ABI version 13
- OK: Loaded parser for ledger: ABI version 13
- OK: Loaded parser for llvm: ABI version 13
- OK: Loaded parser for lua: ABI version 13
- OK: Loaded parser for make: ABI version 13
- OK: Loaded parser for markdown: ABI version 13
- OK: Loaded parser for ninja: ABI version 13
- OK: Loaded parser for nix: ABI version 13
- OK: Loaded parser for norg: ABI version 13
- OK: Loaded parser for ocaml: ABI version 13
- OK: Loaded parser for ocaml_interface: ABI version 13
- OK: Loaded parser for pascal: ABI version 13
- OK: Loaded parser for perl: ABI version 13
- OK: Loaded parser for php: ABI version 13
- OK: Loaded parser for pioasm: ABI version 13
- OK: Loaded parser for prisma: ABI version 13
- OK: Loaded parser for pug: ABI version 13
- OK: Loaded parser for python: ABI version 13
- OK: Loaded parser for ql: ABI version 13
- OK: Loaded parser for query: ABI version 13
- OK: Loaded parser for r: ABI version 13
- OK: Loaded parser for rasi: ABI version 13
- OK: Loaded parser for regex: ABI version 13
- OK: Loaded parser for rst: ABI version 13
- OK: Loaded parser for ruby: ABI version 13
- OK: Loaded parser for rust: ABI version 13
- OK: Loaded parser for scala: ABI version 13
- OK: Loaded parser for scss: ABI version 13
- OK: Loaded parser for sparql: ABI version 13
- OK: Loaded parser for supercollider: ABI version 13
- OK: Loaded parser for surface: ABI version 13
- OK: Loaded parser for svelte: ABI version 13
- OK: Loaded parser for tlaplus: ABI version 13
- OK: Loaded parser for toml: ABI version 13
- OK: Loaded parser for tsx: ABI version 13
- OK: Loaded parser for turtle: ABI version 13
- OK: Loaded parser for typescript: ABI version 13
- OK: Loaded parser for vala: ABI version 13
- OK: Loaded parser for verilog: ABI version 13
- OK: Loaded parser for vim: ABI version 13
- OK: Loaded parser for vue: ABI version 13
- OK: Loaded parser for yaml: ABI version 13
- OK: Loaded parser for yang: ABI version 13
- OK: Loaded parser for zig: ABI version 13
vimtex: health#vimtex#check
========================================================================
## VimTeX
- OK: Vim version should have full support!
- OK: General viewer should work properly!
- OK: Compiler should work!
which_key: health#which_key#check
========================================================================
## WhichKey: checking conflicting keymaps
- WARNING: conflicting keymap exists for mode **"n"**, lhs: **"g<lt>"**
- INFO: rhs: `<Cmd>lua require("Comment.api").call("uncomment_linewise_op")<CR>g@`
- WARNING: conflicting keymap exists for mode **"n"**, lhs: **"gc"**
- INFO: rhs: `<Cmd>lua require("Comment.api").call("toggle_linewise_op")<CR>g@`
- WARNING: conflicting keymap exists for mode **"n"**, lhs: **"g>"**
- INFO: rhs: `<Cmd>lua require("Comment.api").call("comment_linewise_op")<CR>g@`
- WARNING: conflicting keymap exists for mode **"n"**, lhs: **"gb"**
- INFO: rhs: `<Cmd>lua require("Comment.api").call("toggle_blockwise_op")<CR>g@`
- WARNING: conflicting keymap exists for mode **"n"**, lhs: **"ys"**
- INFO: rhs: `<Plug>Ysurround`
- WARNING: conflicting keymap exists for mode **"n"**, lhs: **"yS"**
- INFO: rhs: `<Plug>YSurround`
Minimal vimrc that can reproduce this bug.
vim.cmd('packadd packer.nvim')
return require('packer').startup(function()
-- package management
use('wbthomason/packer.nvim')
use('sainnhe/gruvbox-material')
use({
'folke/todo-comments.nvim',
requires = 'nvim-lua/plenary.nvim',
config = function()
require('todo-comments').setup()
end,
})
end)
vim.cmd('colorscheme gruvbox-material')
Steps to reproduce this bug using minimal vimrc
- launch neovim using the
init.lua
above. - paste the following into a source code file (any language), fit the comment delimiters to the specific language.
// PERF: stuff
// HACK: stuff
// TODO: stuff
// NOTE: stuff
// FIX: stuff
// WARN: stuff
- check whether the words in all-caps change background-color
Expected behavior
all the background colours of the TODO comment 'keywords' (e.g. PERF, HACK, TODO, FIX) should fit the colorscheme (aka. gruvbox-material colors).
Actual behavior
the TODO comment (see screenshot) is instead a blue color that doesn't fit the gruvbox-material colorscheme.
is this intentional or if not, can this be solved?
TL;DR
I can't fix this, because this plugin doesn't provide any highlight groups to customize colors, instead it will use existing highlight groups which is used to control the highlights of nvim built-in language server client.
Look at these lines from todo-comments.nvim:
keywords = {
FIX = {
icon = " ", -- icon used for the sign, and in search results
color = "error", -- can be a hex color, or a named color (see below)
alt = { "FIXME", "BUG", "FIXIT", "ISSUE" }, -- a set of other keywords that all map to this FIX keywords
-- signs = false, -- configure signs for some keywords individually
},
TODO = { icon = " ", color = "info" },
HACK = { icon = " ", color = "warning" },
WARN = { icon = " ", color = "warning", alt = { "WARNING", "XXX" } },
PERF = { icon = " ", alt = { "OPTIM", "PERFORMANCE", "OPTIMIZE" } },
NOTE = { icon = " ", color = "hint", alt = { "INFO" } },
},
merge_keywords = true, -- when true, custom keywords will be merged with the defaults
-- highlighting of the line containing the todo comment
-- * before: highlights before the keyword (typically comment characters)
-- * keyword: highlights of the keyword
-- * after: highlights after the keyword (todo text)
highlight = {
before = "", -- "fg" or "bg" or empty
keyword = "wide", -- "fg", "bg", "wide" or empty. (wide is the same as bg, but will also highlight surrounding characters)
after = "fg", -- "fg" or "bg" or empty
-- pattern can be a string, or a table of regexes that will be checked
pattern = [[.*<(KEYWORDS)\s*:]], -- pattern or table of patterns, used for highlightng (vim regex)
-- pattern = { [[.*<(KEYWORDS)\s*:]], [[.*\@(KEYWORDS)\s*]] }, -- pattern used for highlightng (vim regex)
comments_only = true, -- this applies the pattern only inside comments using `commentstring` option
max_line_len = 400, -- ignore lines longer than this
exclude = {}, -- list of file types to exclude highlighting
},
-- list of named colors where we try to extract the guifg from the
-- list of hilight groups or use the hex color if hl not found as a fallback
colors = {
error = { "DiagnosticError", "ErrorMsg", "#DC2626" },
warning = { "DiagnosticWarn", "WarningMsg", "#FBBF24" },
info = { "DiagnosticInfo", "#2563EB" },
hint = { "DiagnosticHint", "#10B981" },
default = { "Identifier", "#7C3AED" },
},
So the "TODO" and "NOTE" comments will use info
and hint
colors respectively, and info
and hint
colors will first check DiagnosticInfo
and DiagnosticHint
hi groups, if the foreground doesn't exist it will fall back to #2563EB
and #10B981
.
The DiagnosticInfo
and DiagnosticHint
hi groups are used to highlight info/hint text via nvim built-in language server client, they are controlled by an option g:gruvbox_material_diagnostic_text_highlight
:
https://github.com/sainnhe/gruvbox-material/blob/3489b32ddc97e07dc38d980bcf00d0022597d330/colors/gruvbox-material.vim#L212-L215
https://github.com/sainnhe/gruvbox-material/blob/3489b32ddc97e07dc38d980bcf00d0022597d330/colors/gruvbox-material.vim#L378-L388
The issue is related to the way the plugin decides about what colors to fall back to.
All of sainnhe's color schemes use the undercurl style to highlight diagnostics (similar to VS Code). It means that plugins which rely on core diagnostic highlight groups to determine their defaults will most likely consistently pick the wrong color.
We are aware of this limitation, but instead of making trade-offs in the colorscheme and sacrifice its current aesthetics, I personally recommend configuring the affected plugins in Neovim's config. Plugins written in Lua usually make it super easy, and todo-comments.nvim is no exception:
require 'todo-comments'.setup {
colors = {
error = { 'Red' },
warning = { 'Yellow' },
info = { 'Blue' },
hint = { 'Green' },
}
}
and voilà:
Below is a list of plugins which are known to cause issues, or have caused issues in the past:
- https://github.com/sainnhe/gruvbox-material/issues/145 (fixed upstream in https://github.com/nvim-lualine/lualine.nvim/pull/836)
- https://github.com/sainnhe/everforest/issues/121 (fixed upstream in https://github.com/akinsho/bufferline.nvim/pull/738)
- https://github.com/sainnhe/sonokai/issues/87
- https://github.com/sainnhe/gruvbox-material/issues/120 (this issue)
As a side note, Tree-sitter natively recognizes and highlights some of these comments, and the colorscheme fully supports these: