nvim_runtime_lua

vim.diagnostic.Opts.VirtualText

Fields12

VirtualText.severity : vim.diagnostic.SeverityFilter | nil

Only show virtual text for diagnostics matching the given severity |diagnostic-severity|

VirtualText.current_line : nil | boolean

Show or hide diagnostics based on the current cursor line. If true, only diagnostics on the current cursor line are shown. If false, all diagnostics are shown except on the current cursor line. If nil, all diagnostics are shown. Updated on |CursorHold|, see 'updatetime'. (default: nil)

VirtualText.source : boolean | "if_many" | nil

Include the diagnostic source in virtual text. Use 'if_many' to only show sources if there is more than one diagnostic source in the buffer. Otherwise, any truthy value means to always show the diagnostic source.

VirtualText.spacing : nil | integer

Amount of empty spaces inserted at the beginning of the virtual text.

VirtualText.prefix : string | fun(diagnostic: vim.Diagnostic, i: integer, total: integer) -> string | nil

Prepend diagnostic message with prefix. If a function, {i} is the index of the diagnostic being evaluated, and {total} is the total number of diagnostics for the line. This can be used to render diagnostic symbols or error codes.

VirtualText.suffix : string | fun(diagnostic: vim.Diagnostic) -> string | nil

Append diagnostic message with suffix. This can be used to render an LSP diagnostic error code.

VirtualText.format : fun(diagnostic: vim.Diagnostic) -> nil | string | nil
VirtualText.hl_mode : "replace" | "combine" | "blend" | nil

See |nvimbufset_extmark()|.

VirtualText.virt_text : (string, any)[] | nil

See |nvimbufset_extmark()|.

VirtualText.virt_text_pos : "eol" | "eol_right_align" | "inline" | "overlay" | "right_align" | nil

See |nvimbufset_extmark()|.

VirtualText.virt_text_win_col : nil | integer

See |nvimbufset_extmark()|.

VirtualText.virt_text_hide : nil | boolean

See |nvimbufset_extmark()|.