Home Explore Blog CI



neovim

4th chunk of `runtime/doc/diagnostic.txt`
cbc56cad2fc1298ad4ef8784a692a62ac27e4b0262ad9bfd0000000100000fb7
 begin with `Diagnostic` followed by
the type of highlight (e.g., `Sign`, `Underline`, etc.) and the severity (e.g.
`Error`, `Warn`, etc.)

By default, highlights for signs, floating windows, and virtual text are linked to the
corresponding default highlight. Underline highlights are not linked and use their
own default highlight groups.

For example, the default highlighting for |hl-DiagnosticSignError| is linked
to |hl-DiagnosticError|. To change the default (and therefore the linked
highlights), use the |:highlight| command: >vim

    highlight DiagnosticError guifg="BrightRed"
<
                                                        *hl-DiagnosticError*
DiagnosticError
    Used as the base highlight group.
    Other Diagnostic highlights link to this by default (except Underline)

                                                        *hl-DiagnosticWarn*
DiagnosticWarn
    Used as the base highlight group.
    Other Diagnostic highlights link to this by default (except Underline)

                                                        *hl-DiagnosticInfo*
DiagnosticInfo
    Used as the base highlight group.
    Other Diagnostic highlights link to this by default (except Underline)

                                                        *hl-DiagnosticHint*
DiagnosticHint
    Used as the base highlight group.
    Other Diagnostic highlights link to this by default (except Underline)

                                                        *hl-DiagnosticOk*
DiagnosticOk
    Used as the base highlight group.
    Other Diagnostic highlights link to this by default (except Underline)

                                        *hl-DiagnosticVirtualTextError*
DiagnosticVirtualTextError
    Used for "Error" diagnostic virtual text.

                                        *hl-DiagnosticVirtualTextWarn*
DiagnosticVirtualTextWarn
    Used for "Warn" diagnostic virtual text.

                                                *hl-DiagnosticVirtualTextInfo*
DiagnosticVirtualTextInfo
    Used for "Info" diagnostic virtual text.

                                                *hl-DiagnosticVirtualTextHint*
DiagnosticVirtualTextHint
    Used for "Hint" diagnostic virtual text.

                                                *hl-DiagnosticVirtualTextOk*
DiagnosticVirtualTextOk
    Used for "Ok" diagnostic virtual text.

                                            *hl-DiagnosticVirtualLinesError*
DiagnosticVirtualLinesError
    Used for "Error" diagnostic virtual lines.

                                            *hl-DiagnosticVirtualLinesWarn*
DiagnosticVirtualLinesWarn
    Used for "Warn" diagnostic virtual lines.

                                            *hl-DiagnosticVirtualLinesInfo*
DiagnosticVirtualLinesInfo
    Used for "Info" diagnostic virtual lines.

                                            *hl-DiagnosticVirtualLinesHint*
DiagnosticVirtualLinesHint
    Used for "Hint" diagnostic virtual lines.

                                                *hl-DiagnosticVirtualLinesOk*
DiagnosticVirtualLinesOk
    Used for "Ok" diagnostic virtual lines.

                                                *hl-DiagnosticUnderlineError*
DiagnosticUnderlineError
    Used to underline "Error" diagnostics.

                                                *hl-DiagnosticUnderlineWarn*
DiagnosticUnderlineWarn
    Used to underline "Warn" diagnostics.

                                                *hl-DiagnosticUnderlineInfo*
DiagnosticUnderlineInfo
    Used to underline "Info" diagnostics.

                                                *hl-DiagnosticUnderlineHint*
DiagnosticUnderlineHint
    Used to underline "Hint" diagnostics.

                                                *hl-DiagnosticUnderlineOk*
DiagnosticUnderlineOk
    Used to underline "Ok" diagnostics.

                                                *hl-DiagnosticFloatingError*
DiagnosticFloatingError
    Used to color "Error" diagnostic messages in diagnostics float.
    See |vim.diagnostic.open_float()|

Title: Diagnostic Highlights: Default Groups and Virtual Text
Summary
This section details the default highlight groups used for diagnostics in Vim, including `DiagnosticError`, `DiagnosticWarn`, `DiagnosticInfo`, `DiagnosticHint`, and `DiagnosticOk`. It explains how these groups are used as the base for other diagnostic highlights, such as signs, floating windows, and virtual text, except for underline highlights. It also lists the specific highlight groups for virtual text, virtual lines, underline, and floating windows for different diagnostic severities (Error, Warn, Info, Hint, Ok).