sainnhe / gruvbox-material

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

Add suppor for nvim-navic #166

Closed xeluxee closed 1 year ago

xeluxee commented 1 year ago

https://github.com/SmiteshP/nvim-navic is a Neovim plugin to show current code context in winbar or statusline. Its highlight groups are similar to CmpItemKind* ones, e.g. NavicIconsMethod and NavicIconsConstant. They can be found in its README.

sainnhe commented 1 year ago

Sorry but I'm too busy recently, I'll look into it when I have time.

And your can also add support for it by yourself, PR is always welcome :)

antoineco commented 1 year ago

I use navic too[^1]:

image

I agree with the suggestion, adding colors would be a nice touch. It's also not a big risk (i.e. won't disturb users) because navic's highlights are off by default.

You can experiment with different settings in your own Neovim config by declaring an augroup like below, then submit a proposal once you're happy with the result:

-- Apply custom highlights on colorscheme change.
-- Must be declared before executing ':colorscheme'.
grpid = vim.api.nvim_create_augroup('custom_highlights_gruvboxmaterial', {})
vim.api.nvim_create_autocmd('ColorScheme', {
  group = grpid,
  pattern = 'gruvbox-material',
  command = -- navic icon colors
            'hi NavicIconsMethod   guifg=#c35e0a |' ..
            'hi NavicIconsConstant guifg=#b47109'
})

Ideally we should align on the colors used in LSP autocompletions:

image

[^1]: Here shown with Everforest, a sister colorscheme from sainnhe originally adapted from gruvbox-material.

xeluxee commented 1 year ago

Since nvim-cmp, nvim-navic and aerial.nvim require highlights for LSP item kinds, we could define a color for each kind and assign (or link) highlight groups accordingly, as onedark.nvim does