echasnovski / mini.nvim

Library of 40+ independent Lua modules improving overall Neovim (version 0.8 and higher) experience with minimal effort
MIT License
4.84k stars 183 forks source link

Keywords like local and function are not highlighted in mini.hues colorscheme #1156

Closed 231tr0n closed 3 weeks ago

231tr0n commented 3 weeks ago

Contributing guidelines

Module(s)

mini.hues

Description

mini.hues is not highlighting keywords like local and function in lua. image

Neovim version

NVIM v0.11.0-dev-632+g33464189b

Steps to reproduce

  1. Just install mini.hues
  2. Run command colorscheme randomhue
  3. You can see that local and function keyowords are not highlighted.

Expected behavior

These keywords to be highlighted.

Actual behavior

These keywords are not highlighted.

echasnovski commented 3 weeks ago

They should be highlighted as bold with "normal" foreground. If this is with enabled tree-sitter highlighting (which looks like it), then these words are highlighted with @keyword highlight group. It links to Keyword, which links to Statement which is bold with normal foreground.

Does executing :Inspect on local (or any other word which you think is not highlighted) show @keyword.lua links to Statement)? If yes, what does :hi Statement show? It should contain something like cterm=bold gui=bold. If yes, then it is probably because bold font is configured to be the same as the normal font. 'mini.hues' relies on bold attribute quite a lot, so it is better to have it set up if you want to use 'mini.hues'.

231tr0n commented 3 weeks ago

They should be highlighted as bold with "normal" foreground. If this is with enabled tree-sitter highlighting (which looks like it), then these words are highlighted with @keyword highlight group. It links to Keyword, which links to Statement which is bold with normal foreground.

Does executing :Inspect on local (or any other word which you think is not highlighted) show @keyword.lua links to Statement)? If yes, what does :hi Statement show? It should contain something like cterm=bold gui=bold. If yes, then it is probably because bold font is configured to be the same as the normal font. 'mini.hues' relies on bold attribute quite a lot, so it is better to have it set up if you want to use 'mini.hues'.

Your are right ok so the differentiation is bold. But cant we just use some color to highlight these. Is that possible in any way with mini.hues @echasnovski

echasnovski commented 3 weeks ago

But cant we just use some color to highlight these.

The default will stay bold. This adds an extra way to differentiate words without using new color.

Is that possible in any way with mini.hues

Of course. You can tweak any highlight group after 'mini.hues' defines highlight groups. To do that, add vim.api.nvim_set_hl() call after loading particular color scheme or executing require('mini.hues').setup().

In this particular case, calling vim.api.nvim_set_hl(0, 'Keyword', { fg = '#FF0000' }) will redefine keyword highlighting.