tinted-theming / base16-vim

base16-vim refreshes and commits new themes weekly automatically and has a documented build process.
https://github.com/base16-project/base16
Other
103 stars 21 forks source link

Add missing Treesitter highlights #78

Closed JamyGolden closed 5 months ago

JamyGolden commented 5 months ago

Description

There are basically no Treesitter highlights. This PR adds missing definitions, including for markdown which was mentioned as missing here: https://github.com/tinted-theming/base16-vim/issues/77

GordianDziwis commented 5 months ago

Aren't the treesitter highlights already linked to other highlight groups by default?

Redefining them can lead to inconsistencies between code highlighted with LSP, treesitter and vim highlighting.

Also the version check can be done with:

" Check for Neovim version 0.5 or newer
if has('nvim-0.5')
    " Apply configurations specific to Neovim 0.5 or newer
    source ~/.config/nvim/new_feature_config.vim
endif

" Direct version comparison (for major and minor, not patch)
if v:version >= 800
    " This is for Vim, but similar logic could be adapted for Neovim
    " if a more granular check than has('nvim-0.5') is needed
endif
JamyGolden commented 5 months ago

The markdown highlight groups weren't set at least, so those need to be added. What do you suggest? Removing the highlight groups added in this PR except for the markdown ones?

GordianDziwis commented 5 months ago

The markdown ones are set on my system, but I do use the nightly branch and the nvim-treesitter plugin. Do you know how to find out where the highlights are set?

JamyGolden commented 4 months ago

The treesitter markdown highlights should not be set if one is using a git hash before this commit was merged. What do you mean by "Do you know how to find out where the highlights are set?"?

GordianDziwis commented 4 months ago

Sorry, I was not clear, I meant: In which source files are the built-in treesitter highlights defined.

JamyGolden commented 4 months ago

Ah right, I found them by manually checking the available highlight groups in nvim :highlight markup and saw the auto completed values, but here is a list of them: https://github.com/nvim-treesitter/nvim-treesitter/blob/master/CONTRIBUTING.md#markup