mirror of
https://github.com/neovim/neovim.git
synced 2024-12-24 05:05:00 -07:00
feat(colorscheme): update treesitter groups
Problem: Currently default color scheme defines most of treesitter highlight groups. This might be an issue for users defining their own color scheme as it breaks the "fallback property" for some of groups. Solution: Define less default treesitter groups; just enough for default color scheme to be useful. That is: - All first level groups (`@character`, `@string`, etc.). - All `@xxx.builtin` groups as a most common subgroup. - Some special cases (links/URLs, `@diff.xxx`, etc.).
This commit is contained in:
parent
d4bd6b1eaa
commit
1e0996b572
@ -422,8 +422,9 @@ instance, to highlight comments differently per language: >vim
|
|||||||
hi @comment.lua guifg=DarkBlue
|
hi @comment.lua guifg=DarkBlue
|
||||||
hi link @comment.documentation.java String
|
hi link @comment.documentation.java String
|
||||||
<
|
<
|
||||||
The following captures are linked by default to standard |group-name|s (use
|
The following is a list of standard captures used in queries for Nvim,
|
||||||
|:Inspect| on a group to see the current link):
|
highlighted according to the current colorscheme (use |:Inspect| on one to see
|
||||||
|
the exact definition):
|
||||||
|
|
||||||
@variable various variable names
|
@variable various variable names
|
||||||
@variable.builtin built-in variable names (e.g. `this` / `self`)
|
@variable.builtin built-in variable names (e.g. `this` / `self`)
|
||||||
|
@ -224,21 +224,18 @@ static const char *highlight_init_both[] = {
|
|||||||
|
|
||||||
// Treesitter standard groups
|
// Treesitter standard groups
|
||||||
"default link @variable.builtin Special",
|
"default link @variable.builtin Special",
|
||||||
"default link @variable.parameter Identifier",
|
|
||||||
"default link @variable.member Identifier",
|
|
||||||
|
|
||||||
"default link @constant Constant",
|
"default link @constant Constant",
|
||||||
"default link @constant.builtin Special",
|
"default link @constant.builtin Special",
|
||||||
"default link @constant.macro Define",
|
|
||||||
|
|
||||||
"default link @module Structure",
|
"default link @module Structure",
|
||||||
|
"default link @module.builtin Special",
|
||||||
"default link @label Label",
|
"default link @label Label",
|
||||||
|
|
||||||
"default link @string String",
|
"default link @string String",
|
||||||
"default link @string.regexp SpecialChar",
|
"default link @string.regexp @string.special",
|
||||||
"default link @string.escape SpecialChar",
|
"default link @string.escape @string.special",
|
||||||
"default link @string.special SpecialChar",
|
"default link @string.special SpecialChar",
|
||||||
"default link @string.special.symbol Constant",
|
|
||||||
"default link @string.special.url Underlined",
|
"default link @string.special.url Underlined",
|
||||||
|
|
||||||
"default link @character Character",
|
"default link @character Character",
|
||||||
@ -250,35 +247,19 @@ static const char *highlight_init_both[] = {
|
|||||||
|
|
||||||
"default link @type Type",
|
"default link @type Type",
|
||||||
"default link @type.builtin Special",
|
"default link @type.builtin Special",
|
||||||
"default link @type.definition Typedef",
|
|
||||||
"default link @type.qualifier StorageClass",
|
|
||||||
|
|
||||||
"default link @attribute Macro",
|
"default link @attribute Macro",
|
||||||
"default link @property Identifier",
|
"default link @property Identifier",
|
||||||
|
|
||||||
"default link @function Function",
|
"default link @function Function",
|
||||||
"default link @function.builtin Special",
|
"default link @function.builtin Special",
|
||||||
"default link @function.macro Macro",
|
|
||||||
|
|
||||||
"default link @constructor Special",
|
"default link @constructor Special",
|
||||||
"default link @operator Operator",
|
"default link @operator Operator",
|
||||||
|
|
||||||
"default link @keyword Keyword",
|
"default link @keyword Keyword",
|
||||||
"default link @keyword.function Statement",
|
|
||||||
"default link @keyword.operator Operator",
|
|
||||||
"default link @keyword.import Include",
|
|
||||||
"default link @keyword.storage StorageClass",
|
|
||||||
"default link @keyword.repeat Repeat",
|
|
||||||
"default link @keyword.debug Debug",
|
|
||||||
"default link @keyword.exception Exception",
|
|
||||||
|
|
||||||
"default link @keyword.conditional Conditional",
|
"default link @punctuation Delimiter", // fallback for subgroups; never used itself
|
||||||
|
|
||||||
"default link @keyword.directive Preproc",
|
|
||||||
"default link @keyword.directive.define Define",
|
|
||||||
|
|
||||||
"default link @punctuation.delimiter Delimiter",
|
|
||||||
"default link @punctuation.bracket Delimiter",
|
|
||||||
"default link @punctuation.special Special",
|
"default link @punctuation.special Special",
|
||||||
|
|
||||||
"default link @comment Comment",
|
"default link @comment Comment",
|
||||||
@ -290,22 +271,18 @@ static const char *highlight_init_both[] = {
|
|||||||
|
|
||||||
"@markup.strong gui=bold cterm=bold",
|
"@markup.strong gui=bold cterm=bold",
|
||||||
"@markup.italic gui=italic cterm=italic",
|
"@markup.italic gui=italic cterm=italic",
|
||||||
"@markup.strikethrough gui=strikethrough, cterm=strikethrough",
|
"@markup.strikethrough gui=strikethrough cterm=strikethrough",
|
||||||
"@markup.underline gui=underline, cterm=underline",
|
"@markup.underline gui=underline cterm=underline",
|
||||||
|
|
||||||
"default link @markup Special", // fallback for subgroups; never used itself
|
"default link @markup Special", // fallback for subgroups; never used itself
|
||||||
"default link @markup.heading Title",
|
"default link @markup.heading Title",
|
||||||
"default link @markup.environment Structure",
|
|
||||||
"default link @markup.link Underlined",
|
"default link @markup.link Underlined",
|
||||||
"default link @markup.list.checked DiagnosticOk",
|
|
||||||
"default link @markup.list.unchecked DiagnosticWarn",
|
|
||||||
|
|
||||||
"default link @diff.plus Added",
|
"default link @diff.plus Added",
|
||||||
"default link @diff.minus Removed",
|
"default link @diff.minus Removed",
|
||||||
"default link @diff.delta Changed",
|
"default link @diff.delta Changed",
|
||||||
|
|
||||||
"default link @tag Tag",
|
"default link @tag Tag",
|
||||||
"default link @tag.delimiter Delimiter",
|
|
||||||
|
|
||||||
// LSP semantic tokens
|
// LSP semantic tokens
|
||||||
"default link @lsp.type.class @type",
|
"default link @lsp.type.class @type",
|
||||||
|
Loading…
Reference in New Issue
Block a user