sainnhe / gruvbox-material

Gruvbox with Material Palette
MIT License
1.96k stars 166 forks source link

feat: add nvim-navic support and refactor highlighting for nvim-cmp, aerial.nvim and coc.nvim #168

Closed xeluxee closed 1 year ago

xeluxee commented 1 year ago

Fix #166 and refactor highlighting for plugins that need to define a highlight group for each LSP kind. Now a color is associated to every LSP kind (see s:lsp_kind_color), so managing highlights is shorter and simpler. Colors for each kind has been assigned following already existing highlights for nvim-cmp, coc.nvim and aerial.nvim.

I've moved aerial.nvim in if has('nvim') block. I've also noticed that the following Neovim-only plugins are outside of this block, but this should be fixed in another PR:

sainnhe commented 1 year ago

When better performance option is enabled, this color scheme will read the code in colors/gruvbox-material.vim that is in syn_begin ... syn_end code block, and create a new file named after/syntax/<file-type>.vim and place the code in it.

You declared a s:lsp_kind_color which is only available in current script file, it will produce an error when loading generated syntax files because this variable cannot be read in them.

IMO, you should not modify existing code for coc and aerial, simply adding your code for nvim-navic would be OK.

xeluxee commented 1 year ago

You declared a s:lsp_kind_color which is only available in current script file, it will produce an error when loading generated syntax files because this variable cannot be read in them.

I've renamed s:lsp_kind_color to g:gruvbox_material_lsp_kind_color to make it global, and now gruvbox_material_better_performance option is working fine.

sainnhe commented 1 year ago

Another problem is that you defined this variable in if has('nvim'), that means it can't be read in vim, but coc works nicely in both vim and nvim.

I'd suggest you place the definition of this variable after line 472. L369-L472 is where we place predefined highlights.

xeluxee commented 1 year ago

Another problem is that you defined this variable in if has('nvim'), that means it can't be read in vim, but coc works nicely in both vim and nvim.

I'd suggest you place the definition of this variable after line 472. L369-L472 is where we place predefined highlights.

You're right, now it's fixed.

xeluxee commented 1 year ago

Thank you for this! :raised_hands:

Thank you for maintaining this awesome colorscheme along with @sainnhe!

sainnhe commented 1 year ago

LGTM. What do you think ? @antoineco