Home Explore Blog CI



neovim

70th chunk of `runtime/doc/syntax.txt`
fb21416321f93ad74d25cfc22db93c94cb3cb8d6811325590000000100000fa3
 "lead" and "trail"
		in 'listchars'.
							*hl-WildMenu*
WildMenu	Current match in 'wildmenu' completion.
							*hl-WinBar*
WinBar		Window bar of current window.
							*hl-WinBarNC*
WinBarNC	Window bar of not-current windows.

					*hl-User1* *hl-User1..9* *hl-User9*
The 'statusline' syntax allows the use of 9 different highlights in the
statusline and ruler (via 'rulerformat').  The names are User1 to User9.

For the GUI you can use the following groups to set the colors for the menu,
scrollbars and tooltips.  They don't have defaults.  This doesn't work for the
Win32 GUI.  Only three highlight arguments have any effect here: font, guibg,
and guifg.

							*hl-Menu*
Menu		Current font, background and foreground colors of the menus.
		Also used for the toolbar.
		Applicable highlight arguments: font, guibg, guifg.

							*hl-Scrollbar*
Scrollbar	Current background and foreground of the main window's
		scrollbars.
		Applicable highlight arguments: guibg, guifg.

							*hl-Tooltip*
Tooltip		Current font, background and foreground of the tooltips.
		Applicable highlight arguments: font, guibg, guifg.

==============================================================================
14. Linking groups		*:hi-link* *:highlight-link* *E412* *E413*

When you want to use the same highlighting for several syntax groups, you
can do this more easily by linking the groups into one common highlight
group, and give the color attributes only for that group.

To set a link:

    :hi[ghlight][!] [default] link {from-group} {to-group}

To remove a link:

    :hi[ghlight][!] [default] link {from-group} NONE

Notes:							*E414*
- If the {from-group} and/or {to-group} doesn't exist, it is created.  You
  don't get an error message for a non-existing group.
- As soon as you use a ":highlight" command for a linked group, the link is
  removed.
- If there are already highlight settings for the {from-group}, the link is
  not made, unless the '!' is given.  For a ":highlight link" command in a
  sourced file, you don't get an error message.  This can be used to skip
  links for groups that already have settings.

					*:hi-default* *:highlight-default*
The [default] argument is used for setting the default highlighting for a
group.	If highlighting has already been specified for the group the command
will be ignored.  Also when there is an existing link.

Using [default] is especially useful to overrule the highlighting of a
specific syntax file.  For example, the C syntax file contains: >
	:highlight default link cComment Comment
If you like Question highlighting for C comments, put this in your vimrc file: >
	:highlight link cComment Question
Without the "default" in the C syntax file, the highlighting would be
overruled when the syntax file is loaded.

To have a link survive `:highlight clear`, which is useful if you have
highlighting for a specific filetype and you want to keep it when selecting
another color scheme, put a command like this in the
"after/syntax/{filetype}.vim" file: >
    highlight! default link cComment Question

==============================================================================
15. Cleaning up						*:syn-clear* *E391*

If you want to clear the syntax stuff for the current buffer, you can use this
command: >
  :syntax clear

This command should be used when you want to switch off syntax highlighting,
or when you want to switch to using another syntax.  It's normally not needed
in a syntax file itself, because syntax is cleared by the autocommands that
load the syntax file.
The command also deletes the "b:current_syntax" variable, since no syntax is
loaded after this command.

To clean up specific syntax groups for the current buffer: >
  :syntax clear {group-name} ..
This removes all patterns and keywords for {group-name}.

To clean up specific syntax group lists for the current buffer: >
  :syntax clear @{grouplist-name} ..
This sets {grouplist-name}'s contents to an empty list.

						*:syntax-off* *:syn-off*
If you

Title: Vim Highlighting Groups: User-Defined, GUI Elements, Linking Groups, and Clearing Syntax
Summary
This section details further highlight groups, including highlight of whitespace, current match in wildmenu completion, and window bars of current and non-current windows. Also it covers user-defined highlight groups (User1-User9). It describes how to configure GUI-specific elements like menus, scrollbars, and tooltips. It explains how to link highlight groups for easier management and how to use the ':syntax clear' command to remove syntax highlighting or switch to a different syntax, including cleaning up specific syntax groups.