Closed keiviv closed 2 years ago
This is more of a limitation of nvim-treesitter, which does not offer enough captures (and highlight groups) to distinguish them, even if there's a node for it.
(Nvim-treesitter is more centralized than legacy regex syntax highlighting, where every language was allowed to define whatever highlight groups it wanted without concern for others. While this leads to a more consistent highlighting for standard programming languages, it restricts the possibilities for other types of languages.)
Exactly, the level names are actually emitted as nodes. But if you want you add custom highlight captures as described in the nvim-treesitter README. E.g. add
[
(atx_heading
(atx_h1_marker))
(setext_heading
(setext_h1_underline))
] @text.title1
to markdowns highlights.scm
and
lua <<EOF
require"nvim-treesitter.highlight".set_custom_captures {
["text.title1"] = "markdownH1",
}
EOF
to your config.
The headings level names are missing:
Implementing the levels would significantly improve the readability via color schemes. This module is amazing, and the
H
levels would make it even more spectacular. ❤️