export def InitOnce()
var lineHL: string = opt.lspOptions.diagLineHL
# Signs used for LSP diagnostics
- sign_define([{name: 'LspDiagError', text: 'E>', texthl: 'ErrorMsg',
- linehl: lineHL},
- {name: 'LspDiagWarning', text: 'W>', texthl: 'Search',
- linehl: lineHL},
- {name: 'LspDiagInfo', text: 'I>', texthl: 'Pmenu',
- linehl: lineHL},
- {name: 'LspDiagHint', text: 'H>', texthl: 'Question',
- linehl: lineHL}])
+ 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
+ }
+ ])
+ 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 })
+ endif
+
if opt.lspOptions.showDiagWithVirtualText
if !hlexists('LspDiagVirtualText')
hlset([{name: 'LspDiagVirtualText',
command to display the code action for the current
line, use a popup menu instead of echoing.
By default this is set to false.
+highlightDiagInline |Boolean| option. Highlight the diagnostics inline
+ By default this is set to false.
+diagInlineErrorHL |String| option. The highlight group used for
+ inline error highlight. By default uses "SpellBad"
+diagInlineWarningHL |String| option. The highlight group used for
+ inline warning highlight. By default uses "SpellCap"
+diagInlineInfoHL |String| option. The highlight group used for
+ inline info highlight. By default uses "SpellRare"
+diagInlineHintHL |String| option. The highlight group used for
+ inline hint highlight. By default uses "SpellLocal"
+
For example, to disable the automatic placement of signs for the LSP
diagnostic messages, you can add the following line to your .vimrc file: >