diff options
author | Christian Clason <c.clason@uni-graz.at> | 2025-03-08 17:40:56 +0100 |
---|---|---|
committer | Christian Clason <ch.clason+github@icloud.com> | 2025-03-09 13:52:54 +0100 |
commit | 903242f160faff5f7e3b9ae1a5273ac75a55ed6b (patch) | |
tree | 980945a765da349f98609d249f906fd0b5a1c8b3 | |
parent | 0a087f207331291a0ef7f1773eb9cdf7f5143879 (diff) | |
download | rneovim-903242f160faff5f7e3b9ae1a5273ac75a55ed6b.tar.gz rneovim-903242f160faff5f7e3b9ae1a5273ac75a55ed6b.tar.bz2 rneovim-903242f160faff5f7e3b9ae1a5273ac75a55ed6b.zip |
docs(highlight): collect all default highlight groups
Problem: It's difficult for colorscheme authors to know which highlight
groups should be defined.
Solution: List and link to all built-in highlight group categories. Also
remove outdated text on "preferred" and "secondary" groups.
-rw-r--r-- | runtime/doc/syntax.txt | 30 | ||||
-rw-r--r-- | runtime/doc/vim_diff.txt | 3 |
2 files changed, 16 insertions, 17 deletions
diff --git a/runtime/doc/syntax.txt b/runtime/doc/syntax.txt index 3a19ee55c3..b4c7a5f96a 100644 --- a/runtime/doc/syntax.txt +++ b/runtime/doc/syntax.txt @@ -246,12 +246,6 @@ Added added line in a diff Changed changed line in a diff Removed removed line in a diff -The names marked with * are the preferred groups; the others are minor groups. -For the preferred groups, the "syntax.vim" file contains default highlighting. -The minor groups are linked to the preferred groups, so they get the same -highlighting. You can override these defaults by using ":highlight" commands -after sourcing the "syntax.vim" file. - Note that highlight group names are not case sensitive. "String" and "string" can be used for the same group. @@ -4816,16 +4810,20 @@ is mostly used, because it looks better. ============================================================================== 13. Highlight command *:highlight* *:hi* *E28* *E411* *E415* -There are two types of highlight groups: -- The built-in |highlight-groups|. -- The ones used for specific languages. For these the name starts with the - name of the language. Many of these don't have any attributes, but are - linked to a group of the second type. - *hitest.vim* -You can see all the groups currently active with this command: > - :so $VIMRUNTIME/syntax/hitest.vim -This will open a new window containing all highlight group names, displayed -in their own color. +Nvim uses a range of highlight groups which fall into two categories: Editor +interface and syntax highlighting. In rough order of importance, these are +- basic editor |highlight-groups| +- standard syntax |group-name|s (in addition, syntax files can define + language-specific groups, which are prefixed with the language name) +- |diagnostic-highlights| +- |tree-sitter-highlight-groups| +- |lsp-semantic-highlight| groups +- |lsp-highlight| of symbols and references + +Where appropriate, highlight groups are linked by default to one of the more basic +groups, but colorschemes are expected to cover all of them. Under each tag, +the corresponding highlight groups are highlighted using the current +colorscheme. *:colo* *:colorscheme* *E185* :colo[rscheme] Output the name of the currently active color scheme. diff --git a/runtime/doc/vim_diff.txt b/runtime/doc/vim_diff.txt index a4b3e9711b..8d8b97fe31 100644 --- a/runtime/doc/vim_diff.txt +++ b/runtime/doc/vim_diff.txt @@ -34,7 +34,8 @@ Defaults *defaults* *nvim-defaults* looking differently due to them relying on how highlight groups are defined by default. Add ":colorscheme vim" to |init.vim| or ":source $VIMRUNTIME/colors/vim.lua" to your color scheme file to restore - the old default links and colors. + the old default links and colors. See |:highlight| for a list of highlight + groups colorschemes should set. - 'autoindent' is enabled - 'autoread' is enabled (works in all UIs, including terminal) |