simrat39 / symbols-outline.nvim

A tree like view for symbols in Neovim using the Language Server Protocol. Supports all your favourite languages.
MIT License
1.85k stars 97 forks source link

How to enable icon coloring? #196

Closed mpas closed 1 year ago

mpas commented 1 year ago

I have installed the plugin into LunarVim. When I open the outline the icons appear to have no color. Other icons like the ones in treesittter are nicely colored. Any hint on how I can enable the colors?

image

jonarrien commented 1 year ago

Not using LunarVim, but I guess it's missing the highlight groups defined by default. You can configure different ones in symbols section.

In my case, I had to change:

You can check the available ones using :highlight.

johnmathews commented 1 year ago

I have the same issue, my hunch is that it isnt about undefined highlight groups, as icons in other outline plugins, and nvim-tree, are colored ok.

image
ehaynes99 commented 1 year ago

This is a change in treesitter that needs to be update in this library.

https://github.com/nvim-treesitter/nvim-treesitter/issues/2293#issuecomment-1279974776

https://github.com/nvim-treesitter/nvim-treesitter/pull/3656 removed the obsolete TS* highlighting groups. Users and plugins should instead directly use the capture name as a highlight group. E.g., instead of

hi link TSPunctDelimit Delimiter do

hi link @punctuation.delimiter Delimiter

@johnmathews note that nvim-tree (and many others), use https://github.com/nvim-tree/nvim-web-devicons/blob/master/lua/nvim-web-devicons.lua These have distinct colors hardcoded, so not relying on treesitter.