nvim_runtime_lua

vim.diagnostic.Opts

Many of the configuration options below accept one of the following:

  • false: Disable this feature
  • true: Enable this feature, use default settings.
  • table: Enable this feature with overrides. Use an empty table to use default values.
  • function: Function with signature (namespace, bufnr) that returns any of the above.

Fields9

Opts.underline : boolean | vim.diagnostic.Opts.Underline | fun(namespace: integer, bufnr: integer) -> vim.diagnostic.Opts.Underline | nil

Used to call attention to a diagnostic ("underline" is a misnomer). Controls the |hl-DiagnosticUnnecessary| and |hl-DiagnosticDeprecated| highlights. (default: true)

Opts.virtual_text : boolean | vim.diagnostic.Opts.VirtualText | fun(namespace: integer, bufnr: integer) -> vim.diagnostic.Opts.VirtualText | nil

Use virtual text for diagnostics. If multiple diagnostics are set for a namespace, one prefix per diagnostic + the last diagnostic message are shown. (default: false)

Opts.virtual_lines : boolean | vim.diagnostic.Opts.VirtualLines | fun(namespace: integer, bufnr: integer) -> vim.diagnostic.Opts.VirtualLines | nil

Use virtual lines for diagnostics. (default: false)

Opts.signs : boolean | vim.diagnostic.Opts.Signs | fun(namespace: integer, bufnr: integer) -> vim.diagnostic.Opts.Signs | nil

Use signs for diagnostics |diagnostic-signs|. (default: true)

Opts.float : boolean | vim.diagnostic.Opts.Float | fun(namespace: integer | integer[] | nil, bufnr: integer) -> vim.diagnostic.Opts.Float | nil

Options for floating windows. See |vim.diagnostic.Opts.Float|.

Opts.status : vim.diagnostic.Opts.Status | nil

Options for the statusline component.

Opts.update_in_insert : nil | boolean

Update diagnostics in Insert mode (if false, diagnostics are updated on |InsertLeave|) (default: false)

Opts.severity_sort : boolean | { reverse: boolean? } | nil

Sort diagnostics by severity. This affects the order in which signs, virtual text, and highlights are displayed. When true, higher severities are displayed before lower severities (e.g. ERROR is displayed before WARN). Options:

  • {reverse}? (boolean) Reverse sort order
  • (default: false)

Opts.jump : vim.diagnostic.Opts.Jump | nil

Default values for |vim.diagnostic.jump()|. See |vim.diagnostic.Opts.Jump|.