ikatyang / tree-sitter-yaml

YAML grammar for tree-sitter
https://ikatyang.github.io/tree-sitter-yaml/
MIT License
94 stars 38 forks source link

feature: more colour please #28

Open ghost opened 3 years ago

ghost commented 3 years ago

While using tree-sitter and YAMl, I opened this issue since I thought my theme (Nord) was not correct. Turns out it is, the tree-sitter configuration just has fewer colours than the vanilla one.

Could we please have more colours?

I am happy to test things if you want me to.

solidassassin commented 3 years ago

Tree-sitter is not responsible for the displayed color, TSField group is used to color the keys in yaml (which is accurate in my opinion). The problem here is that your theme provider chose a "boring" color for that certain field, this was probably done because dull colors look better for js objects or lua tables (keys use the same group). You can just modify the TSField color with an autocommand, here's what comes to mind for me:

augroup theming
    au!
    au BufEnter *.{yaml,yml} :hi TSField guifg=a_better_color
    au BufEnter *{.yaml,.yml}\@<! :hi TSField guifg=original_color
augroup END
esn89 commented 2 years ago

I am having the same problem where most of the text is just plain ol' white with coloured colons.

I have tried to do it like this as a test:

:highlight link yamlKey CocListYellowCyan

But it returns with an error like so: E414: group has settings, highlight link ignored. Is this by design or what?