# Initialize the signs and the text property type used for diagnostics.
export def InitOnce()
- var lineHL: string = opt.lspOptions.diagLineHL
# Signs used for LSP diagnostics
+ hlset([{name: 'LspDiagLine', default: true, linksto: 'DiffAdd'}])
+ hlset([{name: 'LspDiagSignErrorText', default: true, linksto: 'ErrorMsg'}])
+ hlset([{name: 'LspDiagSignWarningText', default: true, linksto: 'Search'}])
+ hlset([{name: 'LspDiagSignInfoText', default: true, linksto: 'Pmenu'}])
+ hlset([{name: 'LspDiagSignHintText', default: true, linksto: 'Question'}])
sign_define([
- {
- name: 'LspDiagError',
- text: opt.lspOptions.diagSignErrorText,
- texthl: opt.lspOptions.diagSignErrorTexthl,
- linehl: lineHL
- },
- {
- name: 'LspDiagWarning',
- text: opt.lspOptions.diagSignWarningText,
- texthl: opt.lspOptions.diagSignWarningTexthl,
- linehl: lineHL
- },
- {
- name: 'LspDiagInfo',
- text: opt.lspOptions.diagSignInfoText,
- texthl: opt.lspOptions.diagSignInfoTexthl,
- linehl: lineHL
- },
- {
- name: 'LspDiagHint',
- text: opt.lspOptions.diagSignHintText,
- texthl: opt.lspOptions.diagSignHintTexthl,
- linehl: lineHL
- }
+ {
+ name: 'LspDiagError',
+ text: opt.lspOptions.diagSignErrorText,
+ texthl: 'LspDiagSignErrorText',
+ linehl: 'LspDiagLine'
+ },
+ {
+ name: 'LspDiagWarning',
+ text: opt.lspOptions.diagSignWarningText,
+ texthl: 'LspDiagSignWarningText',
+ linehl: 'LspDiagLine'
+ },
+ {
+ name: 'LspDiagInfo',
+ text: opt.lspOptions.diagSignInfoText,
+ texthl: 'LspDiagSignInfoText',
+ linehl: 'LspDiagLine'
+ },
+ {
+ name: 'LspDiagHint',
+ text: opt.lspOptions.diagSignHintText,
+ texthl: 'LspDiagSignHintText',
+ linehl: 'LspDiagLine'
+ }
])
if opt.lspOptions.highlightDiagInline
- if !hlexists('LspDiagInlineError')
- hlset([{name: 'LspDiagInlineError', linksto: opt.lspOptions.diagInlineErrorHL}])
- endif
- if !hlexists('LspDiagInlineWarning')
- hlset([{name: 'LspDiagInlineWarning', linksto: opt.lspOptions.diagInlineWarningHL}])
- endif
- if !hlexists('LspDiagInlineInfo')
- hlset([{name: 'LspDiagInlineInfo', linksto: opt.lspOptions.diagInlineInfoHL}])
- endif
- if !hlexists('LspDiagInlineHint')
- hlset([{name: 'LspDiagInlineHint', linksto: opt.lspOptions.diagInlineHintHL}])
- endif
- prop_type_add('LspDiagInlineError', { highlight: 'LspDiagInlineError', override: true })
- prop_type_add('LspDiagInlineWarning', { highlight: 'LspDiagInlineWarning', override: true })
- prop_type_add('LspDiagInlineInfo', { highlight: 'LspDiagInlineInfo', override: true })
- prop_type_add('LspDiagInlineHint', { highlight: 'LspDiagInlineHint', override: true })
+ hlset([{name: 'LspDiagInlineError', default: true, linksto: 'SpellBad'}])
+ hlset([{name: 'LspDiagInlineWarning', default: true, linksto: 'SpellCap'}])
+ hlset([{name: 'LspDiagInlineInfo', default: true, linksto: 'SpellRare'}])
+ hlset([{name: 'LspDiagInlineHint', default: true, linksto: 'SpellLocal'}])
+ prop_type_add('LspDiagInlineError',
+ { highlight: 'LspDiagInlineError', override: true })
+ prop_type_add('LspDiagInlineWarning',
+ { highlight: 'LspDiagInlineWarning', override: true })
+ prop_type_add('LspDiagInlineInfo',
+ { highlight: 'LspDiagInlineInfo', override: true })
+ prop_type_add('LspDiagInlineHint',
+ { highlight: 'LspDiagInlineHint', override: true })
endif
if opt.lspOptions.showDiagWithVirtualText
- if !hlexists('LspDiagVirtualText')
- hlset([{name: 'LspDiagVirtualText',
- linksto: opt.lspOptions.diagVirtualTextHL}])
- endif
+ hlset([{name: 'LspDiagVirtualText', default: true, linksto: 'LineNr'}])
prop_type_add('LspDiagVirtualText', {highlight: 'LspDiagVirtualText',
override: true})
endif
# Initialize the highlight group and the text property type used for
# inlay hints.
export def InitOnce()
- if !hlexists('LspInlayHintsType')
- hlset([{name: 'LspInlayHintsType', linksto: 'Label'}])
- endif
- if !hlexists('LspInlayHintsParam')
- hlset([{name: 'LspInlayHintsParam', linksto: 'Conceal'}])
- endif
+ hlset([{name: 'LspInlayHintsType', default: true, linksto: 'Label'}])
+ hlset([{name: 'LspInlayHintsParam', default: true, linksto: 'Conceal'}])
prop_type_add('LspInlayHintsType', {highlight: 'LspInlayHintsType'})
prop_type_add('LspInlayHintsParam', {highlight: 'LspInlayHintsParam'})
enddef
# icase | fuzzy | case match for language servers that replies with a full
# list of completion items
completionMatcher: 'case',
- # The highlight group used inline Error diagnostics
- diagInlineErrorHL: 'SpellBad',
- # The highlight group used inline Hint diagnostics
- diagInlineHintHL: 'SpellLocal',
- # The highlight group used inline Info diagnostics
- diagInlineInfoHL: 'SpellRare',
- # The highlight group used inline Warning diagnostics
- diagInlineWarningHL: 'SpellCap',
- # Default diagnostic highlight on lines
- diagLineHL: 'DiffAdd',
# diagnostics signs options
diagSignErrorText: 'E>',
- diagSignErrorTexthl: 'ErrorMsg',
diagSignHintText: 'H>',
- diagSignHintTexthl: 'Question',
diagSignInfoText: 'I>',
- diagSignInfoTexthl: 'Pmenu',
diagSignWarningText: 'W>',
- diagSignWarningTexthl: 'Search',
- # The highlight group used for a diagnostics virtual text
- diagVirtualTextHL: 'LineNr',
# In insert mode, echo the current symbol signature in the status line
# instead of showing it in a popup
echoSignature: false,
case - case sensitive matching (default).
fuzzy - fuzzy match completion items.
icase - ignore case when matching items.
-diagInlineErrorHL |String| option. The highlight group used for
- inline error highlight. By default uses "SpellBad"
-diagInlineHintHL |String| option. The highlight group used for
- inline hint highlight. By default uses "SpellLocal"
-diagInlineInfoHL |String| option. The highlight group used for
- inline info highlight. By default uses "SpellRare"
-diagInlineWarningHL |String| option. The highlight group used for
- inline warning highlight. By default uses "SpellCap"
-diagLineHL |String| option. The highlight group used for a line
- with one or more diagnostics. By default uses
- "DiffAdd". Use "NONE" to disable.
diagSignErrorText |String| option. Change diag sign text for errors
By default 'E>'
-diagSignErrorTexthl |String| option. Change diag sign highlight for errors
- By default 'ErrorMsg',
diagSignHintText |String| option. Change diag sign text for hints
By default 'H>',
-diagSignHintTexthl |String| option. Change diag sign highlight for hints
- By default 'Question',
diagSignInfoText |String| option. Change diag sign text for info
By default 'I>',
-diagSignInfoTexthl |String| option. Change diag sign text highlight info
- By default 'Pmenu',
diagSignWarningText |String| option. Change diag sign text for warnings
By default 'W>',
-diagSignWarningTexthl |String| option. Change diag sign highlight for warnings
- By default 'Search',
-diagVirtualTextHL |String| option. The highlight group used for a
- diagnostics virtual text. By default uses "LineNr".
echoSignature |Boolean| option. In insert mode, echo the current
symbol signature instead of showing it in a popup.
By default this is set to false.
these highlight groups in your .vimrc file before sourcing this plugin to
override them.
+LspDiagLine Used to highlight a line with one or more
+ diagnostics. By default linked to the
+ "DiffAdd" highlight group. Use "NONE" to
+ disable.
LspDiagInlineError Used to highlight inline error diagnostics.
By default, linked to the "SpellBad" highlight
group.
LspDiagInlineWarning Used to highlight inline warning diagnostics.
By default, linked to the "SpellCap" highlight
group.
+LspDiagSignErrorText Used to highlight the sign text for error
+ diags. By default linked to 'ErrorMsg'.
+LspDiagSignHintText Used to highlight the sign text for hint
+ diags. By default linked to 'Question'.
+LspDiagSignInfoText Used to highlight the sign text for info
+ diags. By default linked to 'Pmenu'.
+LspDiagSignWarningText Used to highlight the sign text for warning
+ diags. By default linked to 'Search'.
LspDiagVirtualText Used to highlight diagnostic virtual text.
By default, linked to the "LineNr" highlight
group.